From e1d433a233029ec4303fc40e27df150114e5a7bd Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 24 Sep 2015 20:01:55 +0000 Subject: [PATCH] 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 --- src/wp-admin/edit-form-advanced.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index 2d9fea3d41..419b66c6df 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/wp-admin/edit-form-advanced.php @@ -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' ) ) {