Indent a foreach.

git-svn-id: https://develop.svn.wordpress.org/trunk@16509 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-11-20 19:20:32 +00:00
parent 358a4a3486
commit bc868ac452
1 changed files with 26 additions and 26 deletions

View File

@ -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) )