Make WordPress Core

Ticket #54159: 54159.1.diff

File 54159.1.diff, 841 bytes (added by audrasjb, 3 years ago)

patch refreshed against trunk

  • src/wp-includes/comment-template.php

    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 ) { 
    12411241        $_post = get_post( $post_id );
    12421242
    12431243        $post_id = $_post ? $_post->ID : 0;
    1244         $open    = ( 'open' === $_post->comment_status );
     1244        $open    = $_post && ( 'open' === $_post->comment_status );
    12451245
    12461246        /**
    12471247         * Filters whether the current post is open for comments.
    function pings_open( $post_id = null ) { 
    12711271        $_post = get_post( $post_id );
    12721272
    12731273        $post_id = $_post ? $_post->ID : 0;
    1274         $open    = ( 'open' === $_post->ping_status );
     1274        $open    = $_post && ( 'open' === $_post->ping_status );
    12751275
    12761276        /**
    12771277         * Filters whether the current post is open for pings.