<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23707] trunk/wp-admin: Turn the Nav Menu meta boxes into an accordion.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23707">23707</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2013-03-15 13:16:38 +0000 (Fri, 15 Mar 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Turn the Nav Menu meta boxes into an accordion. Less sprawling and overwhelming.
* Registration stays the same ?\226?\128?\148 they're meta boxes
* Call `do_accordion_sections()` instead of `do_meta_boxes()` and they render as an accordion
props DrewAPicture, lessbloat, jkudish. fixes <a href="http://core.trac.wordpress.org/ticket/23450">#23450</a>. see <a href="http://core.trac.wordpress.org/ticket/23449">#23449</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsswpadmincss">trunk/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunkwpadminincludesnavmenuphp">trunk/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminjsnavmenujs">trunk/wp-admin/js/nav-menu.js</a></li>
<li><a href="#trunkwpadminnavmenusphp">trunk/wp-admin/nav-menus.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin.css (23706 => 23707)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.css        2013-03-15 06:58:36 UTC (rev 23706)
+++ trunk/wp-admin/css/wp-admin.css        2013-03-15 13:16:38 UTC (rev 23707)
</span><span class="lines">@@ -6037,6 +6037,10 @@
</span><span class="cx">         overflow: auto;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.wp-full-overlay-sidebar-content .accordion-section:first-child {
+        border-top: 1px solid #fff;
+}
+
</ins><span class="cx"> /* Close Link */
</span><span class="cx"> .wp-full-overlay .close-full-overlay {
</span><span class="cx">         text-decoration: none;
</span><span class="lines">@@ -7202,6 +7206,29 @@
</span><span class="cx">         display: block;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#nav-menu-meta ul.outer-border {
+        -webkit-border-radius: 3px;
+        border-radius: 3px;
+}
+
+.accordion-section ul.category-tabs,
+.accordion-section ul.add-menu-item-tabs,
+.accordion-section ul.wp-tab-bar {
+        margin: 0;
+}
+
+.accordion-section .categorychecklist {
+        margin: 13px 0;
+}
+
+#nav-menu-meta .accordion-section-content {
+        padding: 18px 13px;
+}
+
+#nav-menu-meta .button-controls {
+        margin-bottom: 0;
+}
+
</ins><span class="cx"> #nav-menus-frame {
</span><span class="cx">         margin-left: 300px;
</span><span class="cx">         margin-top: 28px;
</span><span class="lines">@@ -7331,7 +7358,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .nav-menus-php #post-body {
</span><del>-        padding: 0 10px;
</del><ins>+        padding: 0 10px 10px;
</ins><span class="cx">         border-width: 1px 0;
</span><span class="cx">         border-style: solid;
</span><span class="cx"> }
</span><span class="lines">@@ -7401,15 +7428,38 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* Add Menu Item Boxes */
</span><del>-.postbox .howto input {
</del><ins>+.postbox .howto input,
+.accordion-container .howto input {
</ins><span class="cx">         width: 180px;
</span><span class="cx">         float: right;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.accordion-container .outer-border {
+        margin-top: 0;
+}
+
+.accordion-container .accordion-section:first-child {
+        -webkit-border-top-right-radius: 3px;
+        -webkit-border-top-left-radius: 3px;
+        border-top-right-radius: 3px;
+        border-top-left-radius: 3px;
+}
+
+.accordion-container .accordion-section:last-child {
+        -webkit-border-bottom-right-radius: 3px;
+        -webkit-border-bottom-left-radius: 3px;
+        border-bottom-right-radius: 3px;
+        border-bottom-left-radius: 3px;
+}
+
</ins><span class="cx"> .customlinkdiv .howto input {
</span><del>-        width: 200px;
</del><ins>+        width: 180px;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+.customlinkdiv p {
+        margin-top: 0
+}
+
</ins><span class="cx"> #nav-menu-theme-locations .howto select {
</span><span class="cx">         width: 100%;
</span><span class="cx"> }
</span><span class="lines">@@ -8818,6 +8868,10 @@
</span><span class="cx">         margin: 0;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.accordion-section:first-child {
+        border-top: 1px solid #dfdfdf;
+}
+
</ins><span class="cx"> .accordion-section:last-child {
</span><span class="cx">         box-shadow: 0 1px 0 0px #fff;
</span><span class="cx"> }
</span><span class="lines">@@ -8825,6 +8879,8 @@
</span><span class="cx"> .accordion-section.open .accordion-section-content {
</span><span class="cx">         display: block;
</span><span class="cx">         background: #fdfdfd;
</span><ins>+        border-left: 1px solid #dfdfdf;
+        border-right: 1px solid #dfdfdf;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .accordion-section.open:hover {
</span><span class="lines">@@ -8841,6 +8897,8 @@
</span><span class="cx">         margin: 0;
</span><span class="cx">         padding: 15px 20px;
</span><span class="cx">         position: relative;
</span><ins>+        border-left: 1px solid #dfdfdf;
+        border-right: 1px solid #dfdfdf;
</ins><span class="cx">
</span><span class="cx">         cursor: pointer;
</span><span class="cx">
</span><span class="lines">@@ -8914,6 +8972,8 @@
</span><span class="cx">         background-image: -moz-linear-gradient(bottom, #6d6d6d, #808080);
</span><span class="cx">         background-image: -o-linear-gradient(bottom, #6d6d6d, #808080);
</span><span class="cx">         background-image: linear-gradient(to top, #6d6d6d, #808080);
</span><ins>+        border-left: 1px solid #808080;
+        border-right: 1px solid #808080;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .control-section.accordion-section:hover,
</span></span></pre></div>
<a id="trunkwpadminincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/nav-menu.php (23706 => 23707)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/nav-menu.php        2013-03-15 06:58:36 UTC (rev 23706)
+++ trunk/wp-admin/includes/nav-menu.php        2013-03-15 13:16:38 UTC (rev 23707)
</span><span class="lines">@@ -387,11 +387,11 @@
</span><span class="cx"> function wp_nav_menu_setup() {
</span><span class="cx">         // Register meta boxes
</span><span class="cx">         wp_nav_menu_post_type_meta_boxes();
</span><del>-        add_meta_box( 'add-custom-links', __( 'Add Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
</del><ins>+        add_meta_box( 'add-custom-links', __( 'Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
</ins><span class="cx">         wp_nav_menu_taxonomy_meta_boxes();
</span><span class="cx">
</span><span class="cx">         // Register advanced menu items (columns)
</span><del>-        add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns');
</del><ins>+        add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );
</ins><span class="cx">
</span><span class="cx">         // If first time editing, disable advanced items by default.
</span><span class="cx">         if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {
</span><span class="lines">@@ -447,7 +447,9 @@
</span><span class="cx">                 $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
</span><span class="cx">                 if ( $post_type ) {
</span><span class="cx">                         $id = $post_type->name;
</span><del>-                        add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );
</del><ins>+                        // give pages a higher priority
+                        $priority = ( 'page' == $post_type->name ? 'core' : 'default' );
+                        add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type );
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -565,22 +567,21 @@
</span><span class="cx">
</span><span class="cx">         ?>
</span><span class="cx">         <div class="customlinkdiv" id="customlinkdiv">
</span><ins>+                <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
+                <p id="menu-item-url-wrap">
+                        <label class="howto" for="custom-menu-item-url">
+                                <span><?php _e('URL'); ?></span>
+                                <input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text" class="code menu-item-textbox" value="http://" />
+                        </label>
+                </p>
</ins><span class="cx">
</span><del>-                        <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
-                        <p id="menu-item-url-wrap">
-                                <label class="howto" for="custom-menu-item-url">
-                                        <span><?php _e('URL'); ?></span>
-                                        <input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text" class="code menu-item-textbox" value="http://" />
-                                </label>
-                        </p>
</del><ins>+                <p id="menu-item-name-wrap">
+                        <label class="howto" for="custom-menu-item-name">
+                                <span><?php _e( 'Link Text' ); ?></span>
+                                <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Menu Item'); ?>" />
+                        </label>
+                </p>
</ins><span class="cx">
</span><del>-                        <p id="menu-item-name-wrap">
-                                <label class="howto" for="custom-menu-item-name">
-                                        <span><?php _e( 'Link Text' ); ?></span>
-                                        <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Menu Item'); ?>" />
-                                </label>
-                        </p>
-
</del><span class="cx">                 <p class="button-controls">
</span><span class="cx">                         <span class="add-to-menu">
</span><span class="cx">                                 <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-custom-menu-item" id="submit-customlinkdiv" />
</span><span class="lines">@@ -683,10 +684,22 @@
</span><span class="cx">         ?>
</span><span class="cx">         <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
</span><span class="cx">                 <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
</span><del>-                        <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent"><?php _e('Most Recent'); ?></a></li>
-                        <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li>
-                        <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li>
-                </ul>
</del><ins>+                        <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                                <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-most-recent" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent">
+                                        <?php _e( 'Most Recent' ); ?>
+                                </a>
+                        </li>
+                        <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                                <a class="nav-tab-link" data-type="<?php echo esc_attr( $post_type_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all">
+                                        <?php _e( 'View All' ); ?>
+                                </a>
+                        </li>
+                        <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                                <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-search" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
+                                        <?php _e( 'Search'); ?>
+                                </a>
+                        </li>
+                </ul><!-- .posttype-tabs -->
</ins><span class="cx">
</span><span class="cx">                 <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php
</span><span class="cx">                         echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
</span><span class="lines">@@ -893,10 +906,22 @@
</span><span class="cx">         ?>
</span><span class="cx">         <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
</span><span class="cx">                 <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
</span><del>-                        <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop"><?php _e('Most Used'); ?></a></li>
-                        <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all"><?php _e('View All'); ?></a></li>
-                        <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"><?php _e('Search'); ?></a></li>
-                </ul>
</del><ins>+                        <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                                <a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-pop" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop">
+                                        <?php _e( 'Most Used' ); ?>
+                                </a>
+                        </li>
+                        <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                                <a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all">
+                                        <?php _e( 'View All' ); ?>
+                                </a>
+                        </li>
+                        <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                                <a class="nav-tab-link" data-type="tabs-panel-search-taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
+                                        <?php _e( 'Search' ); ?>
+                                </a>
+                        </li>
+                </ul><!-- .taxonomy-tabs -->
</ins><span class="cx">
</span><span class="cx">                 <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
</span><span class="cx">                         echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (23706 => 23707)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2013-03-15 06:58:36 UTC (rev 23706)
+++ trunk/wp-admin/includes/template.php        2013-03-15 13:16:38 UTC (rev 23707)
</span><span class="lines">@@ -968,6 +968,70 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Meta Box Accordion Template Function
+ *
+ * Largely made up of abstracted code from {@link do_meta_boxes()}, this
+ * function serves to build meta boxes as list items for display as
+ * a collapsible accordion.
+ *
+ * @since 3.6.0
+ *
+ * @uses global $wp_meta_boxes Used to retrieve registered meta boxes.
+ *
+ * @param string|object $screen The screen identifier.
+ * @param string $context The meta box context.
+ * @param mixed $object gets passed to the section callback function as first parameter.
+ * @return int number of meta boxes as accordion sections.
+ */
+function do_accordion_sections( $screen, $context, $object ) {
+        global $wp_meta_boxes;
+
+        if ( empty( $screen ) )
+                $screen = get_current_screen();
+        elseif ( is_string( $screen ) )
+                $screen = convert_to_screen( $screen );
+
+        $page = $screen->id;
+
+        $hidden = get_hidden_meta_boxes( $screen );
+        ?>
+        <div id="side-sortables" class="accordion-container">
+                <ul class="outer-border">
+        <?php
+        $i = 0;
+        do {
+                if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[$page] ) || ! isset( $wp_meta_boxes[$page][$context] ) )
+                        break;
+
+                foreach ( array( 'high', 'sorted', 'core', 'default', 'low' ) as $priority ) {
+                        if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) {
+                                foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) {
+                                        if ( false == $box || ! $box['title'] )
+                                                continue;
+                                        $i++;
+                                        $hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
+                                        ?>
+                                        <li class="control-section accordion-section <?php echo $hidden_class; ?> <?php echo esc_attr( $box['id'] ); ?>" id="<?php echo esc_attr( $box['id'] ); ?>">
+                                                <h3 class="accordion-section-title hndle" tabindex="0" title="<?php echo esc_attr( $box['title'] ); ?>"><?php echo esc_html( $box['title'] ); ?></h3>
+                                                <div class="accordion-section-content <?php postbox_classes( $box['id'], $page ); ?>">
+                                                        <div class="inside">
+                                                                <?php call_user_func( $box['callback'], $object, $box ); ?>
+                                                        </div><!-- .inside -->
+                                                </div><!-- .accordion-section-content -->
+                                        </li><!-- .accordion-section -->
+                                        <?php
+                                }
+                        }
+                }
+        } while(0);
+        ?>
+                </ul><!-- .outer-border -->
+        </div><!-- .accordion-container -->
+        <?php
+        return $i;
+}
+
+/**
</ins><span class="cx"> * Add a new section to a settings page.
</span><span class="cx"> *
</span><span class="cx"> * Part of the Settings API. Use this to define new settings sections for an admin page.
</span></span></pre></div>
<a id="trunkwpadminjsnavmenujs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/nav-menu.js (23706 => 23707)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/nav-menu.js        2013-03-15 06:58:36 UTC (rev 23706)
+++ trunk/wp-admin/js/nav-menu.js        2013-03-15 13:16:38 UTC (rev 23707)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">
</span><span class="cx">                         this.attachUnsavedChangesListener();
</span><span class="cx">
</span><del>-                        if( api.menuList.length ) // If no menu, we're in the + tab.
</del><ins>+                        if( api.menuList.length )
</ins><span class="cx">                                 this.initSortables();
</span><span class="cx">
</span><span class="cx">                         if( oneThemeLocationNoMenus )
</span><span class="lines">@@ -51,6 +51,9 @@
</span><span class="cx">                         this.initAccessibility();
</span><span class="cx">
</span><span class="cx">                         this.initToggles();
</span><ins>+
+                        // Open first accordion option
+                        this.initAccordion();
</ins><span class="cx">                 },
</span><span class="cx">
</span><span class="cx">                 jQueryExtensions : function() {
</span><span class="lines">@@ -262,6 +265,12 @@
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><span class="cx">
</span><ins>+                initAccordion : function() {
+                        var accordionOptions = $( '.accordion-container li.accordion-section' );
+                        accordionOptions.removeClass('open');
+                        accordionOptions.filter(':visible').first().addClass( 'open' );
+                },
+
</ins><span class="cx">                 initAccessibility : function() {
</span><span class="cx">                         $( '.item-edit' ).off( 'focus' ).on( 'focus', function(){
</span><span class="cx">                                 $(this).on( 'keydown', function(e){
</span><span class="lines">@@ -391,6 +400,18 @@
</span><span class="cx">                         }
</span><span class="cx">                         // hide fields
</span><span class="cx">                         api.menuList.hideAdvancedMenuItemFields();
</span><ins>+
+                        $('.hide-postbox-tog').click(function () {
+                                api.initAccordion();
+
+                                var hidden = $( '.accordion-container li.accordion-section' ).filter(':hidden').map(function() { return this.id; }).get().join(',');
+                                $.post(ajaxurl, {
+                                        action: 'closed-postboxes',
+                                        hidden: hidden,
+                                        closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
+                                        page: 'nav-menus'
+                                });
+                        });
</ins><span class="cx">                 },
</span><span class="cx">
</span><span class="cx">                 initSortables : function() {
</span><span class="lines">@@ -786,14 +807,11 @@
</span><span class="cx">                                         target = $(e.target);
</span><span class="cx">
</span><span class="cx">                                 if ( target.hasClass('nav-tab-link') ) {
</span><del>-                                        panelId = /#(.*)$/.exec(e.target.href);
-                                        if ( panelId && panelId[1] )
-                                                panelId = panelId[1]
-                                        else
-                                                return false;
</del><span class="cx">
</span><del>-                                        wrapper = target.parents('.inside').first();
</del><ins>+                                        panelId = target.data( 'type' );
</ins><span class="cx">
</span><ins>+                                        wrapper = target.parents('.accordion-section-content').first();
+
</ins><span class="cx">                                         // upon changing tabs, we want to uncheck all checkboxes
</span><span class="cx">                                         $('input', wrapper).removeAttr('checked');
</span><span class="cx">
</span><span class="lines">@@ -806,7 +824,7 @@
</span><span class="cx">                                         // select the search bar
</span><span class="cx">                                         $('.quick-search', wrapper).focus();
</span><span class="cx">
</span><del>-                                        return false;
</del><ins>+                                        e.preventDefault();
</ins><span class="cx">                                 } else if ( target.hasClass('select-all') ) {
</span><span class="cx">                                         selectAreaMatch = /#(.*)$/.exec(e.target.href);
</span><span class="cx">                                         if ( selectAreaMatch && selectAreaMatch[1] ) {
</span></span></pre></div>
<a id="trunkwpadminnavmenusphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/nav-menus.php (23706 => 23707)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2013-03-15 06:58:36 UTC (rev 23706)
+++ trunk/wp-admin/nav-menus.php        2013-03-15 13:16:38 UTC (rev 23707)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx">         wp_die( __( 'Cheatin&#8217; uh?' ) );
</span><span class="cx">
</span><span class="cx"> wp_enqueue_script( 'nav-menu' );
</span><ins>+wp_enqueue_script( 'accordion' );
</ins><span class="cx">
</span><span class="cx"> if ( wp_is_mobile() )
</span><span class="cx">         wp_enqueue_script( 'jquery-touch-punch' );
</span><span class="lines">@@ -510,7 +511,7 @@
</span><span class="cx">                         <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
</span><span class="cx">                         <input type="hidden" name="action" value="add-menu-item" />
</span><span class="cx">                         <?php wp_nonce_field( 'add-menu_item', 'menu-settings-column-nonce' ); ?>
</span><del>-                        <?php do_meta_boxes( 'nav-menus', 'side', null ); ?>
</del><ins>+                        <?php do_accordion_sections( 'nav-menus', 'side', null ); ?>
</ins><span class="cx">                 </form>
</span><span class="cx">
</span><span class="cx">         </div><!-- /#menu-settings-column -->
</span></span></pre>
</div>
</div>
</body>
</html>