Fix initial hidden meta boxes for nav menus. see #13134

git-svn-id: http://svn.automattic.com/wordpress/trunk@14304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-04-29 18:27:46 +00:00
parent 5f501c920c
commit 8420f41a24
2 changed files with 17 additions and 18 deletions

View File

@ -321,7 +321,8 @@ function wp_nav_menu_setup() {
function wp_initial_nav_menu_meta_boxes() {
global $wp_meta_boxes;
if ( !get_user_option( 'meta-box-hidden_nav-menus' ) && is_array($wp_meta_boxes) ) {
if ( get_user_option( 'metaboxhidden_nav-menus' ) || ! is_array($wp_meta_boxes) )
return;
$initial_meta_boxes = array( 'manage-menu', 'create-menu', 'add-custom-links', 'add-page', 'add-category' );
$hidden_meta_boxes = array();
@ -339,10 +340,7 @@ function wp_initial_nav_menu_meta_boxes() {
}
$user = wp_get_current_user();
update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );
// returns all the hidden metaboxes to the js function: wpNavMenu.initial_meta_boxes()
return join( ',', $hidden_meta_boxes );
}
$option = get_user_option( 'metaboxhidden_nav-menus', $user->ID);
}
/**

View File

@ -319,6 +319,8 @@ if ( current_theme_supports('nav-menus') ) {
$messages[] = '<div id="message" class="error"><p>' . __('The current theme does not support menus.') . '</p></div>';
}
wp_initial_nav_menu_meta_boxes();
// Get the admin header
require_once( 'admin-header.php' );
?>
@ -403,7 +405,6 @@ require_once( 'admin-header.php' );
<?php wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' ); ?>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
<input type="hidden" id="hidden-metaboxes" value="<?php echo wp_initial_nav_menu_meta_boxes(); ?>" />
</div><!--END #nav-menu-header-->
<div id="post-body">
<div id="post-body-content">