Make WordPress Core

Ticket #32582: 32582.3.diff

File 32582.3.diff, 731 bytes (added by swissspidy, 10 years ago)

After talking to obenland, we came up with a more straightforward solution. I tested it on different screens and also with a couple of plugins that add meta boxes to the menu screen. Works like a charm.

  • src/wp-admin/includes/screen.php

    diff --git src/wp-admin/includes/screen.php src/wp-admin/includes/screen.php
    index 582c659..4e40efc 100644
    function meta_box_prefs( $screen ) { 
    7878        $hidden = get_hidden_meta_boxes($screen);
    7979
    8080        foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) {
    81                 foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) {
     81                foreach ( array('high', 'core', 'default', 'low') as $priority ) {
     82                        if ( ! isset( $wp_meta_boxes[$screen->id][$context][$priority] ) ) {
     83                                continue;
     84                        }
    8285                        foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) {
    8386                                if ( false == $box || ! $box['title'] )
    8487                                        continue;