diff --git src/wp-admin/includes/screen.php src/wp-admin/includes/screen.php
index 582c659..1a43236 100644
|
|
function meta_box_prefs( $screen ) { |
78 | 78 | $hidden = get_hidden_meta_boxes($screen); |
79 | 79 | |
80 | 80 | foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) { |
81 | | foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) { |
| 81 | $priorities = array_keys( $wp_meta_boxes[$screen->id][$context] ); |
| 82 | usort( $priorities, '_usort_meta_box_prefs_by_priority' ); |
| 83 | |
| 84 | foreach ( $priorities as $priority ) { |
82 | 85 | foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) { |
83 | 86 | if ( false == $box || ! $box['title'] ) |
84 | 87 | continue; |
… |
… |
function meta_box_prefs( $screen ) { |
95 | 98 | } |
96 | 99 | |
97 | 100 | /** |
| 101 | * Sort meta box priorities. |
| 102 | * |
| 103 | * Used by usort() as a callback, should not be used directly. |
| 104 | * |
| 105 | * @since 4.3.0 |
| 106 | * @access private |
| 107 | * |
| 108 | * @param string $a |
| 109 | * @param string $b |
| 110 | * |
| 111 | * @return int |
| 112 | */ |
| 113 | function _usort_meta_box_prefs_by_priority( $a, $b ) { |
| 114 | $priorities = array( |
| 115 | 'high' => 10, |
| 116 | 'core' => 8, |
| 117 | 'default' => 5, |
| 118 | 'low' => 1, |
| 119 | ); |
| 120 | |
| 121 | return $priorities[ $b ] - $priorities[ $a ]; |
| 122 | } |
| 123 | |
| 124 | /** |
98 | 125 | * Get Hidden Meta Boxes |
99 | 126 | * |
100 | 127 | * @since 2.7.0 |