Make WordPress Core

Ticket #46604: 46604.patch

File 46604.patch, 691 bytes (added by sabernhardt, 3 years ago)

checks $post variable and post_status before displaying panel content

  • src/wp-content/themes/twentyseventeen/inc/template-tags.php

     
    145145                setup_postdata( $post );
    146146                set_query_var( 'panel', $id );
    147147
    148                 get_template_part( 'template-parts/page/content', 'front-page-panels' );
     148                if ( $post && in_array( $post->post_status, array( 'publish', 'private' ) ) ) {
     149                        get_template_part( 'template-parts/page/content', 'front-page-panels' );
     150                }
    149151
    150152                wp_reset_postdata();
    151153        } elseif ( is_customize_preview() ) {