The 'commentsdiv' meta box isn't displayed when using custom post statuses
|Reported by:||XyntaMan||Owned by:|
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');