Skip to content

Commit ceae14b

Browse files
committed
General: Add comment explaining use of queried object in feed_links_extra() instead of global $post.
Follow-up to [61056]. Props mukesh27, westonruter. See #63263. git-svn-id: https://develop.svn.wordpress.org/trunk@61058 602fd350-edb4-49c9-b593-d223f7449a82
1 parent fbe72e4 commit ceae14b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wp-includes/general-template.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3326,6 +3326,10 @@ function feed_links_extra( $args = array() ) {
33263326
*/
33273327
$args = apply_filters( 'feed_links_extra_args', $args );
33283328

3329+
/*
3330+
* The template conditionals are referring to the global query, so the queried object is used rather than
3331+
* depending on a global $post being set.
3332+
*/
33293333
$queried_object = get_queried_object();
33303334
if ( is_singular() && $queried_object instanceof WP_Post ) {
33313335
$post = $queried_object;

0 commit comments

Comments
 (0)