diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php
index e45088729f..3f68aa4900 100644
a
|
b
|
function comments_open( $post_id = null ) { |
1241 | 1241 | $_post = get_post( $post_id ); |
1242 | 1242 | |
1243 | 1243 | $post_id = $_post ? $_post->ID : 0; |
1244 | | $open = ( 'open' === $_post->comment_status ); |
| 1244 | $open = $_post && ( 'open' === $_post->comment_status ); |
1245 | 1245 | |
1246 | 1246 | /** |
1247 | 1247 | * Filters whether the current post is open for comments. |
… |
… |
function pings_open( $post_id = null ) { |
1271 | 1271 | $_post = get_post( $post_id ); |
1272 | 1272 | |
1273 | 1273 | $post_id = $_post ? $_post->ID : 0; |
1274 | | $open = ( 'open' === $_post->ping_status ); |
| 1274 | $open = $_post && ( 'open' === $_post->ping_status ); |
1275 | 1275 | |
1276 | 1276 | /** |
1277 | 1277 | * Filters whether the current post is open for pings. |