mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 15:47:05 +00:00
Taxonomy: Use WP_Term object to retrieve the taxonomy in get_term_feed_link().
This change fixes a backward compatibility issue introduced in [52180] where `get_term_feed_link()` did not honor the `$taxonomy` parameter anymore. Rather than using the default `category` taxonomy when passing a term ID in `get_term_feed_link()`, use the `WP_Term` object to get the taxonomy. Follow-up to [52180]. Props hugod. Fixes #50225. git-svn-id: https://develop.svn.wordpress.org/trunk@52255 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -930,14 +930,13 @@ function get_category_feed_link( $cat, $feed = '' ) {
|
||||
*/
|
||||
function get_term_feed_link( $term, $taxonomy = '', $feed = '' ) {
|
||||
if ( ! is_object( $term ) ) {
|
||||
$term = (int) $term;
|
||||
$taxonomy = 'category';
|
||||
} elseif ( ! $term instanceof WP_Term ) {
|
||||
$taxonomy = $term->taxonomy;
|
||||
$term = (int) $term;
|
||||
}
|
||||
|
||||
$term = get_term( $term, $taxonomy );
|
||||
|
||||
$taxonomy = $term->taxonomy;
|
||||
|
||||
if ( empty( $term ) || is_wp_error( $term ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user