WordPress.org

Make WordPress Core

Changeset 34515


Ignore:
Timestamp:
09/24/2015 08:01:55 PM (5 years ago)
Author:
wonderboymusic
Message:

Edit Post: in the logic determining whether to display the Comments meta box, check for the current post status in get_post_stati( array( 'public' => true ) ) instead of just checking publish and private. Ensure that private is checked in both instances.

Props Thaicloud, wonderboymusic.
Fixes #24486.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r34486 r34515  
    291291}
    292292
    293 if ( 'publish' === get_post_status( $post ) || 'private' === get_post_status( $post ) ) {
     293$stati = get_post_stati( array( 'public' => true ) );
     294if ( empty( $stati ) ) {
     295    $stati = array( 'publish' );
     296}
     297$stati[] = 'private';
     298
     299if ( in_array( get_post_status( $post ), $stati ) ) {
    294300    // If the post type support comments, or the post has comments, allow the
    295301    // Comments meta box.
Note: See TracChangeset for help on using the changeset viewer.