Taxonomy: Use get_term_link() instead of get_category_link() in get_term_parents_list().
`get_category_link()` is a wrapper for `get_term_link()`. Using the unwrapped function makes more sense semantically (it's taxonomy- agnostic) and it's also more parsimonious (the `WP_Error` check in `get_category_link()` is redundant with similar checks just before in `get_term_link()`). Props keesiemeijer. Fixes #17069. Built from https://develop.svn.wordpress.org/trunk@39593 git-svn-id: http://core.svn.wordpress.org/trunk@39533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1283,7 +1283,7 @@ function get_term_parents_list( $term_id, $taxonomy, $args = array() ) {
|
||||
$name = ( 'slug' === $args['format'] ) ? $parent->slug : $parent->name;
|
||||
|
||||
if ( $args['link'] ) {
|
||||
$list .= '<a href="' . esc_url( get_category_link( $parent->term_id ) ) . '">' . $name . '</a>' . $args['separator'];
|
||||
$list .= '<a href="' . esc_url( get_term_link( $parent->term_id, $taxonomy ) ) . '">' . $name . '</a>' . $args['separator'];
|
||||
} else {
|
||||
$list .= $name . $args['separator'];
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.8-alpha-39592';
|
||||
$wp_version = '4.8-alpha-39593';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user