Skip to content

Commit 7eb5228

Browse files
committed
Add check for global post being set
1 parent 6f012da commit 7eb5228

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/wp-includes/general-template.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3327,9 +3327,8 @@ function feed_links_extra( $args = array() ) {
33273327
$args = apply_filters( 'feed_links_extra_args', $args );
33283328

33293329
// Singular objects only, excluding a single `show_on_front` Home Page.
3330-
if ( is_singular() && ! is_home() ) {
3331-
$id = 0;
3332-
$post = get_post( $id );
3330+
$post = get_post();
3331+
if ( is_singular() && ! is_home() && $post instanceof WP_Post ) {
33333332

33343333
/** This filter is documented in wp-includes/general-template.php */
33353334
$show_comments_feed = apply_filters( 'feed_links_show_comments_feed', true );

0 commit comments

Comments
 (0)