Make WordPress Core

Changeset 32707


Ignore:
Timestamp:
06/08/2015 12:34:03 PM (10 years ago)
Author:
obenland
Message:

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

Props swissspidy.
Fixes #32582.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/screen.php

    r32655 r32707  
    7878    $hidden = get_hidden_meta_boxes($screen);
    7979
    80     foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) {
    81         foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) {
    82             foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) {
     80    foreach ( array_keys( $wp_meta_boxes[ $screen->id ] ) as $context ) {
     81        foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
     82            if ( ! isset( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] ) ) {
     83                continue;
     84            }
     85            foreach ( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] as $box ) {
    8386                if ( false == $box || ! $box['title'] )
    8487                    continue;
Note: See TracChangeset for help on using the changeset viewer.