File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff 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+ * Use the queried object rather than relying on the global $post.
3331+ * feed_links_extra() should not depend on $GLOBALS['post'] being set. See #63263
3332+ */
33293333 $ queried_object = get_queried_object ();
33303334 if ( is_singular () && $ queried_object instanceof WP_Post ) {
33313335 $ post = $ queried_object ;
@@ -3348,6 +3352,10 @@ function feed_links_extra( $args = array() ) {
33483352 */
33493353 $ show_post_comments_feed = apply_filters ( 'feed_links_extra_show_post_comments_feed ' , $ show_comments_feed );
33503354
3355+ /*
3356+ * Pass the explicit post to comments_open() / pings_open() and
3357+ * the_title_attribute() to avoid relying on globals.
3358+ */
33513359 if ( $ show_post_comments_feed && ( comments_open ( $ post ) || pings_open ( $ post ) || (int ) $ post ->comment_count > 0 ) ) {
33523360 $ title = sprintf (
33533361 $ args ['singletitle ' ],
You can’t perform that action at this time.
0 commit comments