mirror of
git://develop.git.wordpress.org/
synced 2025-02-25 09:03:09 +01:00
Comments: allow meta boxes for Discussion and Comments in extenuating circumstances.
* Discussion: Post Type stops supporting comments, but comments and/or pings are open on a post. * Comments: Post is published or private, the post type has stopped supporting comments, but comments and/or pings are open on a post. Currently, there is no way to toggle those settings off. Props couturefreak, wonderboymusic, rachelbaker. Fixes #28080. git-svn-id: https://develop.svn.wordpress.org/trunk@34461 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
daadd27ed4
commit
a87b30da21
@ -263,11 +263,19 @@ if ( post_type_supports($post_type, 'custom-fields') )
|
||||
*/
|
||||
do_action( 'dbx_post_advanced', $post );
|
||||
|
||||
if ( post_type_supports($post_type, 'comments') )
|
||||
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', null, 'normal', 'core');
|
||||
// Allow the Discussion meta box to show up if the post type supports comments,
|
||||
// or if comments or pings are open.
|
||||
if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {
|
||||
add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core' );
|
||||
}
|
||||
|
||||
if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') )
|
||||
add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core');
|
||||
if ( 'publish' === get_post_status( $post ) || 'private' === get_post_status( $post ) ) {
|
||||
// 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' ) ) {
|
||||
add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) )
|
||||
add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core');
|
||||
|
Loading…
x
Reference in New Issue
Block a user