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:
Boone Gorges 2016-12-13 02:57:41 +00:00
parent 20aa5d7150
commit aa644128d6
2 changed files with 2 additions and 2 deletions

View File

@ -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'];
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.