[wp-trac] [WordPress Trac] #24486: The 'commentsdiv' meta box isn't displayed when using custom post statuses

WordPress Trac noreply at wordpress.org
Mon Jun 3 08:22:39 UTC 2013


#24486: The 'commentsdiv' meta box isn't displayed when using custom post statuses
----------------------------+-----------------------------
 Reporter:  XyntaMan        |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  3.5.1
 Severity:  normal          |   Keywords:
----------------------------+-----------------------------
 The 'commentsdiv' meta box, which shows comments to a post in the admin
 post edit section (and also gives the ability to post additional comments
 straight from there) isn't displayed when the post is set to any non-
 publish or non-private post status, particularly any custom post status.

 As far as I can tell, the problem arises from the fact that the said meta
 box is initialized in "wp-admin/edit-form-advanced.php", where the
 conditional expression for its initialization has the "publish" and
 "private" post statuses hardcoded in:



 {{{
 if ( ('publish' == $post->post_status || 'private' == $post->post_status)
 && post_type_supports($post_type, 'comments') )
         add_meta_box('commentsdiv', __('Comments'),
 'post_comment_meta_box', $post_type, 'normal', 'core');
 }}}

 The existing code is disabling the initialization of the 'commentsdiv'
 meta box in any use case with custom post statuses, reducing their
 usefulness and flexibility.

 In my opinion, the the simplest fix for this would be to remove the post
 status check as a condition for the 'commentsdiv' meta box initialization,
 leaving the "post_type_supports($post_type, 'comments')" as the only
 condition:


 {{{
 if ( post_type_supports($post_type, 'comments') )
         add_meta_box('commentsdiv', __('Comments'),
 'post_comment_meta_box', $post_type, 'normal', 'core');
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24486>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list