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. git-svn-id: https://develop.svn.wordpress.org/trunk@39593 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bc2d2858f9
commit
012d1977e2
@ -1283,7 +1283,7 @@ function get_term_parents_list( $term_id, $taxonomy, $args = array() ) {
|
|||||||
$name = ( 'slug' === $args['format'] ) ? $parent->slug : $parent->name;
|
$name = ( 'slug' === $args['format'] ) ? $parent->slug : $parent->name;
|
||||||
|
|
||||||
if ( $args['link'] ) {
|
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 {
|
} else {
|
||||||
$list .= $name . $args['separator'];
|
$list .= $name . $args['separator'];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user