Taxonomy: Check $term object before using it in `get_term_feed_link()`.
This change performs the type safety check on `$term` before it is used to retrieve the taxonomy in `get_term_feed_link()`. It also updates the related DocBlock after [52255]. Follow up to [52255]. Props dlh. Fixes #50225. Built from https://develop.svn.wordpress.org/trunk@52258 git-svn-id: http://core.svn.wordpress.org/trunk@51850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7cbc31f7c0
commit
1f9eee5410
|
@ -923,7 +923,6 @@ function get_category_feed_link( $cat, $feed = '' ) {
|
||||||
*
|
*
|
||||||
* @param int|WP_Term|object $term The ID or term object whose feed link will be retrieved.
|
* @param int|WP_Term|object $term The ID or term object whose feed link will be retrieved.
|
||||||
* @param string $taxonomy Optional. Taxonomy of `$term_id`.
|
* @param string $taxonomy Optional. Taxonomy of `$term_id`.
|
||||||
* Defaults to 'category' if term ID or non WP_Term object is passed.
|
|
||||||
* @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'.
|
* @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'.
|
||||||
* Default is the value of get_default_feed().
|
* Default is the value of get_default_feed().
|
||||||
* @return string|false Link to the feed for the term specified by $term_id and $taxonomy.
|
* @return string|false Link to the feed for the term specified by $term_id and $taxonomy.
|
||||||
|
@ -935,12 +934,12 @@ function get_term_feed_link( $term, $taxonomy = '', $feed = '' ) {
|
||||||
|
|
||||||
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$taxonomy = $term->taxonomy;
|
||||||
|
|
||||||
if ( empty( $feed ) ) {
|
if ( empty( $feed ) ) {
|
||||||
$feed = get_default_feed();
|
$feed = get_default_feed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.9-alpha-52257';
|
$wp_version = '5.9-alpha-52258';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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