Sort screen options for meta boxes according to the meta box's priority.

Props swissspidy.
Fixes #32582.



git-svn-id: https://develop.svn.wordpress.org/trunk@32707 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Konstantin Obenland 2015-06-08 12:34:03 +00:00
parent 11de1cedaa
commit 99d0d85fb0
1 changed files with 6 additions and 3 deletions

View File

@ -77,9 +77,12 @@ function meta_box_prefs( $screen ) {
$hidden = get_hidden_meta_boxes($screen);
foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) {
foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) {
foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) {
foreach ( array_keys( $wp_meta_boxes[ $screen->id ] ) as $context ) {
foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
if ( ! isset( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] ) ) {
continue;
}
foreach ( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] as $box ) {
if ( false == $box || ! $box['title'] )
continue;
// Submit box cannot be hidden