mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 01:52:24 +01:00
Rework get_hidden_meta_boxes() to leverage a full WP_Screen object. Prevents custom post types from having their explicity supported meta boxes being hidden by default. see #18958.
git-svn-id: https://develop.svn.wordpress.org/trunk@19049 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
62778137cf
commit
de3bf760b6
@ -90,16 +90,21 @@ function get_hidden_meta_boxes( $screen ) {
|
||||
|
||||
$hidden = get_user_option( "metaboxhidden_{$screen->id}" );
|
||||
|
||||
$use_defaults = ! is_array( $hidden );
|
||||
|
||||
// Hide slug boxes by default
|
||||
if ( !is_array( $hidden ) ) {
|
||||
if ( 'post' == $screen->base || 'page' == $screen->base )
|
||||
$hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
|
||||
else
|
||||
$hidden = array( 'slugdiv' );
|
||||
$hidden = apply_filters('default_hidden_meta_boxes', $hidden, $screen);
|
||||
if ( $use_defaults ) {
|
||||
$hidden = array();
|
||||
if ( 'post' == $screen->base ) {
|
||||
if ( 'post' == $screen->post_type || 'page' == $screen->post_type )
|
||||
$hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
|
||||
else
|
||||
$hidden = array( 'slugdiv' );
|
||||
}
|
||||
$hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen );
|
||||
}
|
||||
|
||||
return $hidden;
|
||||
return apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user