mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-09 09:57:38 +01:00
Indent a foreach.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1a0818d477
commit
b306f9f9c6
@ -870,35 +870,35 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $pri
|
||||
$wp_meta_boxes[$page][$context] = array();
|
||||
|
||||
foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) {
|
||||
foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
|
||||
if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) )
|
||||
continue;
|
||||
|
||||
// If a core box was previously added or removed by a plugin, don't add.
|
||||
if ( 'core' == $priority ) {
|
||||
// If core box previously deleted, don't add
|
||||
if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] )
|
||||
foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
|
||||
if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) )
|
||||
continue;
|
||||
|
||||
// If a core box was previously added or removed by a plugin, don't add.
|
||||
if ( 'core' == $priority ) {
|
||||
// If core box previously deleted, don't add
|
||||
if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] )
|
||||
return;
|
||||
// If box was added with default priority, give it core priority to maintain sort order
|
||||
if ( 'default' == $a_priority ) {
|
||||
$wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id];
|
||||
unset($wp_meta_boxes[$page][$a_context]['default'][$id]);
|
||||
}
|
||||
return;
|
||||
// If box was added with default priority, give it core priority to maintain sort order
|
||||
if ( 'default' == $a_priority ) {
|
||||
$wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id];
|
||||
unset($wp_meta_boxes[$page][$a_context]['default'][$id]);
|
||||
}
|
||||
return;
|
||||
// If no priority given and id already present, use existing priority
|
||||
if ( empty($priority) ) {
|
||||
$priority = $a_priority;
|
||||
// else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority.
|
||||
} elseif ( 'sorted' == $priority ) {
|
||||
$title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
|
||||
$callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];
|
||||
$callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args'];
|
||||
}
|
||||
// An id can be in only one priority and one context
|
||||
if ( $priority != $a_priority || $context != $a_context )
|
||||
unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
|
||||
}
|
||||
// If no priority given and id already present, use existing priority
|
||||
if ( empty($priority) ) {
|
||||
$priority = $a_priority;
|
||||
// else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority.
|
||||
} elseif ( 'sorted' == $priority ) {
|
||||
$title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
|
||||
$callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];
|
||||
$callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args'];
|
||||
}
|
||||
// An id can be in only one priority and one context
|
||||
if ( $priority != $a_priority || $context != $a_context )
|
||||
unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty($priority) )
|
||||
|
Loading…
Reference in New Issue
Block a user