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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34515 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-09-24 20:01:55 +00:00
parent 395fc15df3
commit e1d433a233

View File

@ -290,7 +290,13 @@ if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_
add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core' );
}
if ( 'publish' === get_post_status( $post ) || 'private' === get_post_status( $post ) ) {
$stati = get_post_stati( array( 'public' => true ) );
if ( empty( $stati ) ) {
$stati = array( 'publish' );
}
$stati[] = 'private';
if ( in_array( get_post_status( $post ), $stati ) ) {
// If the post type support comments, or the post has comments, allow the
// Comments meta box.
if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {