diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 200b2e095f..5a1b2e22eb 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1241,7 +1241,7 @@ function comments_open( $post_id = null ) { $_post = get_post( $post_id ); $post_id = $_post ? $_post->ID : 0; - $open = ( 'open' === $_post->comment_status ); + $open = ( $_post && ( 'open' === $_post->comment_status ) ); /** * Filters whether the current post is open for comments. @@ -1271,7 +1271,7 @@ function pings_open( $post_id = null ) { $_post = get_post( $post_id ); $post_id = $_post ? $_post->ID : 0; - $open = ( 'open' === $_post->ping_status ); + $open = ( $_post && ( 'open' === $_post->ping_status ) ); /** * Filters whether the current post is open for pings. diff --git a/wp-includes/version.php b/wp-includes/version.php index b03b9a995f..a47de199bf 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-52222'; +$wp_version = '5.9-alpha-52223'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.