mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-01 21:21:24 +01: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. Built from https://develop.svn.wordpress.org/trunk@52255 git-svn-id: http://core.svn.wordpress.org/trunk@51847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
70f43f261b
commit
edd2ca2b6b
@ -930,14 +930,13 @@ function get_category_feed_link( $cat, $feed = '' ) {
|
|||||||
*/
|
*/
|
||||||
function get_term_feed_link( $term, $taxonomy = '', $feed = '' ) {
|
function get_term_feed_link( $term, $taxonomy = '', $feed = '' ) {
|
||||||
if ( ! is_object( $term ) ) {
|
if ( ! is_object( $term ) ) {
|
||||||
$term = (int) $term;
|
$term = (int) $term;
|
||||||
$taxonomy = 'category';
|
|
||||||
} elseif ( ! $term instanceof WP_Term ) {
|
|
||||||
$taxonomy = $term->taxonomy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$term = get_term( $term, $taxonomy );
|
$term = get_term( $term, $taxonomy );
|
||||||
|
|
||||||
|
$taxonomy = $term->taxonomy;
|
||||||
|
|
||||||
if ( empty( $term ) || is_wp_error( $term ) ) {
|
if ( empty( $term ) || is_wp_error( $term ) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.9-alpha-52254';
|
$wp_version = '5.9-alpha-52255';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
Loading…
Reference in New Issue
Block a user