Make WordPress Core

Ticket #23450: 23450.2.diff​

File 23450.2.diff​, 30.6 KB (added by lessbloat, 14 years ago)
Line 
1Index: wp-admin/includes/nav-menu.php
2===================================================================
3--- wp-admin/includes/nav-menu.php (revision 23452)
4+++ wp-admin/includes/nav-menu.php (working copy)
5@@ -385,9 +385,8 @@
6 * @since 3.0.0
7 **/
8 function wp_nav_menu_setup() {
9- // Register meta boxes
10 wp_nav_menu_post_type_meta_boxes();
11- add_meta_box( 'add-custom-links', __( 'Add Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
12+ wp_nav_menu_item_link_meta_box();
13 wp_nav_menu_taxonomy_meta_boxes();
14
15 // Register advanced menu items (columns)
16@@ -447,7 +446,7 @@
17 $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
18 if ( $post_type ) {
19 $id = $post_type->name;
20- add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );
21+ wp_nav_menu_item_post_type_meta_box( $post_type );
22 }
23 }
24 }
25@@ -467,7 +466,7 @@
26 $tax = apply_filters( 'nav_menu_meta_box_object', $tax );
27 if ( $tax ) {
28 $id = $tax->name;
29- add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax );
30+ wp_nav_menu_item_taxonomy_meta_box( $tax );
31 }
32 }
33 }
34@@ -564,7 +563,9 @@
35 );
36
37 ?>
38- <div class="customlinkdiv" id="customlinkdiv">
39+ <li class="control-section accordion-section" id="accordion-section-title_tagline">
40+ <h3 title="" tabindex="0" class="accordion-section-title"><?php _e('Links'); ?></h3>
41+ <div class="customlinkdiv accordion-section-content" id="customlinkdiv">
42
43 <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
44 <p id="menu-item-url-wrap">
45@@ -581,14 +582,15 @@
46 </label>
47 </p>
48
49- <p class="button-controls">
50- <span class="add-to-menu">
51- <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" />
52- <span class="spinner"></span>
53- </span>
54- </p>
55+ <p class="button-controls">
56+ <span class="add-to-menu">
57+ <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" />
58+ <span class="spinner"></span>
59+ </span>
60+ </p>
61
62- </div><!-- /.customlinkdiv -->
63+ </div><!-- /.customlinkdiv -->
64+ </li>
65 <?php
66 }
67
68@@ -600,10 +602,10 @@
69 * @param string $object Not used.
70 * @param string $post_type The post type object.
71 */
72-function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
73+function wp_nav_menu_item_post_type_meta_box( $post_type ) {
74 global $_nav_menu_placeholder, $nav_menu_selected_id;
75
76- $post_type_name = $post_type['args']->name;
77+ $post_type_name = $post_type->name;
78
79 // paginate browsing for large numbers of post objects
80 $per_page = 50;
81@@ -621,8 +623,8 @@
82 'update_post_meta_cache' => false
83 );
84
85- if ( isset( $post_type['args']->_default_query ) )
86- $args = array_merge($args, (array) $post_type['args']->_default_query );
87+ if ( isset( $post_type->_default_query ) )
88+ $args = array_merge($args, (array) $post_type->_default_query );
89
90 // @todo transient caching of these results with proper invalidation on updating of a post of this type
91 $get_posts = new WP_Query;
92@@ -681,132 +683,133 @@
93 );
94
95 ?>
96- <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
97- <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
98- <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>
99- <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>
100- <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>
101- </ul>
102+ <li class="control-section accordion-section" id="accordion-section-title_tagline">
103+ <h3 title="" tabindex="0" class="accordion-section-title"><?php echo $post_type->labels->name; ?></h3>
104+ <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv accordion-section-content">
105+ <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
106+ <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>
107+ <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>
108+ <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>
109+ </ul>
110
111- <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php
112- echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
113- ?>">
114- <ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
115- <?php
116- $recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => 15 ) );
117- $most_recent = $get_posts->query( $recent_args );
118- $args['walker'] = $walker;
119- echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args );
120- ?>
121- </ul>
122- </div><!-- /.tabs-panel -->
123+ <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php
124+ echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
125+ ?>">
126+ <ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
127+ <?php
128+ $recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => 15 ) );
129+ $most_recent = $get_posts->query( $recent_args );
130+ $args['walker'] = $walker;
131+ echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args );
132+ ?>
133+ </ul>
134+ </div><!-- /.tabs-panel -->
135
136- <div class="tabs-panel <?php
137- echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
138- ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
139- <?php
140- if ( isset( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
141- $searched = esc_attr( $_REQUEST['quick-search-posttype-' . $post_type_name] );
142- $search_results = get_posts( array( 's' => $searched, 'post_type' => $post_type_name, 'fields' => 'all', 'order' => 'DESC', ) );
143- } else {
144- $searched = '';
145- $search_results = array();
146- }
147- ?>
148- <p class="quick-search-wrap">
149- <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
150- <span class="spinner"></span>
151- <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
152- </p>
153+ <div class="tabs-panel <?php
154+ echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
155+ ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
156+ <?php
157+ if ( isset( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
158+ $searched = esc_attr( $_REQUEST['quick-search-posttype-' . $post_type_name] );
159+ $search_results = get_posts( array( 's' => $searched, 'post_type' => $post_type_name, 'fields' => 'all', 'order' => 'DESC', ) );
160+ } else {
161+ $searched = '';
162+ $search_results = array();
163+ }
164+ ?>
165+ <p class="quick-search-wrap">
166+ <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
167+ <span class="spinner"></span>
168+ <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
169+ </p>
170
171- <ul id="<?php echo $post_type_name; ?>-search-checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
172- <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
173- <?php
174- $args['walker'] = $walker;
175- echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
176- ?>
177- <?php elseif ( is_wp_error( $search_results ) ) : ?>
178- <li><?php echo $search_results->get_error_message(); ?></li>
179- <?php elseif ( ! empty( $searched ) ) : ?>
180- <li><?php _e('No results found.'); ?></li>
181- <?php endif; ?>
182- </ul>
183- </div><!-- /.tabs-panel -->
184+ <ul id="<?php echo $post_type_name; ?>-search-checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
185+ <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
186+ <?php
187+ $args['walker'] = $walker;
188+ echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
189+ ?>
190+ <?php elseif ( is_wp_error( $search_results ) ) : ?>
191+ <li><?php echo $search_results->get_error_message(); ?></li>
192+ <?php elseif ( ! empty( $searched ) ) : ?>
193+ <li><?php _e('No results found.'); ?></li>
194+ <?php endif; ?>
195+ </ul>
196+ </div><!-- /.tabs-panel -->
197
198- <div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
199- echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
200- ?>">
201- <?php if ( ! empty( $page_links ) ) : ?>
202- <div class="add-menu-item-pagelinks">
203- <?php echo $page_links; ?>
204- </div>
205- <?php endif; ?>
206- <ul id="<?php echo $post_type_name; ?>checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
207- <?php
208- $args['walker'] = $walker;
209+ <div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
210+ echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
211+ ?>">
212+ <?php if ( ! empty( $page_links ) ) : ?>
213+ <div class="add-menu-item-pagelinks">
214+ <?php echo $page_links; ?>
215+ </div>
216+ <?php endif; ?>
217+ <ul id="<?php echo $post_type_name; ?>checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
218+ <?php
219+ $args['walker'] = $walker;
220
221- // if we're dealing with pages, let's put a checkbox for the front page at the top of the list
222- if ( 'page' == $post_type_name ) {
223- $front_page = 'page' == get_option('show_on_front') ? (int) get_option( 'page_on_front' ) : 0;
224- if ( ! empty( $front_page ) ) {
225- $front_page_obj = get_post( $front_page );
226- $front_page_obj->front_or_home = true;
227- array_unshift( $posts, $front_page_obj );
228- } else {
229- $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
230- array_unshift( $posts, (object) array(
231- 'front_or_home' => true,
232- 'ID' => 0,
233- 'object_id' => $_nav_menu_placeholder,
234- 'post_content' => '',
235- 'post_excerpt' => '',
236- 'post_parent' => '',
237- 'post_title' => _x('Home', 'nav menu home label'),
238- 'post_type' => 'nav_menu_item',
239- 'type' => 'custom',
240- 'url' => home_url('/'),
241- ) );
242+ // if we're dealing with pages, let's put a checkbox for the front page at the top of the list
243+ if ( 'page' == $post_type_name ) {
244+ $front_page = 'page' == get_option('show_on_front') ? (int) get_option( 'page_on_front' ) : 0;
245+ if ( ! empty( $front_page ) ) {
246+ $front_page_obj = get_post( $front_page );
247+ $front_page_obj->front_or_home = true;
248+ array_unshift( $posts, $front_page_obj );
249+ } else {
250+ $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
251+ array_unshift( $posts, (object) array(
252+ 'front_or_home' => true,
253+ 'ID' => 0,
254+ 'object_id' => $_nav_menu_placeholder,
255+ 'post_content' => '',
256+ 'post_excerpt' => '',
257+ 'post_parent' => '',
258+ 'post_title' => _x('Home', 'nav menu home label'),
259+ 'post_type' => 'nav_menu_item',
260+ 'type' => 'custom',
261+ 'url' => home_url('/'),
262+ ) );
263+ }
264 }
265- }
266
267- $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type );
268- $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args );
269+ $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type );
270+ $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args );
271
272- if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
273- $checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items);
274+ if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) )
275+ $checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items);
276
277- }
278+ echo $checkbox_items;
279+ ?>
280+ </ul>
281+ <?php if ( ! empty( $page_links ) ) : ?>
282+ <div class="add-menu-item-pagelinks">
283+ <?php echo $page_links; ?>
284+ </div>
285+ <?php endif; ?>
286+ </div><!-- /.tabs-panel -->
287
288- echo $checkbox_items;
289- ?>
290- </ul>
291- <?php if ( ! empty( $page_links ) ) : ?>
292- <div class="add-menu-item-pagelinks">
293- <?php echo $page_links; ?>
294- </div>
295- <?php endif; ?>
296- </div><!-- /.tabs-panel -->
297+ <p class="button-controls">
298+ <span class="list-controls">
299+ <a href="<?php
300+ echo esc_url(add_query_arg(
301+ array(
302+ $post_type_name . '-tab' => 'all',
303+ 'selectall' => 1,
304+ ),
305+ remove_query_arg($removed_args)
306+ ));
307+ ?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
308+ </span>
309
310- <p class="button-controls">
311- <span class="list-controls">
312- <a href="<?php
313- echo esc_url( add_query_arg(
314- array(
315- $post_type_name . '-tab' => 'all',
316- 'selectall' => 1,
317- ),
318- remove_query_arg( $removed_args )
319- ));
320- ?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
321- </span>
322+ <span class="add-to-menu">
323+ <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-post-type-menu-item" id="submit-posttype-<?php echo $post_type_name; ?>" />
324+ <span class="spinner"></span>
325+ </span>
326+ </p>
327
328- <span class="add-to-menu">
329- <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-post-type-menu-item" id="<?php esc_attr_e( 'submit-posttype-' . $post_type_name ); ?>" />
330- <span class="spinner"></span>
331- </span>
332- </p>
333-
334- </div><!-- /.posttypediv -->
335+ </div><!-- /.posttypediv -->
336+ </li>
337 <?php
338 }
339
340@@ -818,9 +821,9 @@
341 * @param string $object Not used.
342 * @param string $taxonomy The taxonomy object.
343 */
344-function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
345+function wp_nav_menu_item_taxonomy_meta_box( $taxonomy ) {
346 global $nav_menu_selected_id;
347- $taxonomy_name = $taxonomy['args']->name;
348+ $taxonomy_name = $taxonomy->name;
349
350 // paginate browsing for large numbers of objects
351 $per_page = 50;
352@@ -842,7 +845,7 @@
353
354 $terms = get_terms( $taxonomy_name, $args );
355
356- if ( ! $terms || is_wp_error($terms) ) {
357+ if ( is_wp_error($terms) ) {
358 echo '<p>' . __( 'No items.' ) . '</p>';
359 return;
360 }
361@@ -891,98 +894,99 @@
362 );
363
364 ?>
365- <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
366- <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
367- <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>
368- <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>
369- <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>
370- </ul>
371+ <li class="control-section accordion-section" id="accordion-section-title_tagline">
372+ <h3 title="" tabindex="0" class="accordion-section-title"><?php echo $taxonomy->labels->name; ?></h3>
373+ <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv accordion-section-content">
374+ <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
375+ <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>
376+ <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>
377+ <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>
378+ </ul>
379
380- <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
381- echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
382- ?>">
383- <ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
384- <?php
385- $popular_terms = get_terms( $taxonomy_name, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
386- $args['walker'] = $walker;
387- echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args );
388- ?>
389- </ul>
390- </div><!-- /.tabs-panel -->
391+ <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
392+ echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
393+ ?>">
394+ <ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
395+ <?php
396+ $popular_terms = get_terms( $taxonomy_name, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
397+ $args['walker'] = $walker;
398+ echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args );
399+ ?>
400+ </ul>
401+ </div><!-- /.tabs-panel -->
402
403- <div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
404- echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
405- ?>">
406- <?php if ( ! empty( $page_links ) ) : ?>
407- <div class="add-menu-item-pagelinks">
408- <?php echo $page_links; ?>
409- </div>
410- <?php endif; ?>
411- <ul id="<?php echo $taxonomy_name; ?>checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
412- <?php
413- $args['walker'] = $walker;
414- echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $terms), 0, (object) $args );
415- ?>
416- </ul>
417- <?php if ( ! empty( $page_links ) ) : ?>
418- <div class="add-menu-item-pagelinks">
419- <?php echo $page_links; ?>
420- </div>
421- <?php endif; ?>
422- </div><!-- /.tabs-panel -->
423+ <div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
424+ echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
425+ ?>">
426+ <?php if ( ! empty( $page_links ) ) : ?>
427+ <div class="add-menu-item-pagelinks">
428+ <?php echo $page_links; ?>
429+ </div>
430+ <?php endif; ?>
431+ <ul id="<?php echo $taxonomy_name; ?>checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
432+ <?php
433+ $args['walker'] = $walker;
434+ echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $terms), 0, (object) $args );
435+ ?>
436+ </ul>
437+ <?php if ( ! empty( $page_links ) ) : ?>
438+ <div class="add-menu-item-pagelinks">
439+ <?php echo $page_links; ?>
440+ </div>
441+ <?php endif; ?>
442+ </div><!-- /.tabs-panel -->
443
444- <div class="tabs-panel <?php
445- echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
446- ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
447- <?php
448- if ( isset( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) {
449- $searched = esc_attr( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] );
450- $search_results = get_terms( $taxonomy_name, array( 'name__like' => $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false ) );
451- } else {
452- $searched = '';
453- $search_results = array();
454- }
455- ?>
456- <p class="quick-search-wrap">
457- <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
458- <span class="spinner"></span>
459- <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
460- </p>
461+ <div class="tabs-panel <?php
462+ echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
463+ ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
464+ <?php
465+ if ( isset( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) {
466+ $searched = esc_attr( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] );
467+ $search_results = get_terms( $taxonomy_name, array( 'name__like' => $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false ) );
468+ } else {
469+ $searched = '';
470+ $search_results = array();
471+ }
472+ ?>
473+ <p class="quick-search-wrap">
474+ <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
475+ <span class="spinner"></span>
476+ <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
477+ </p>
478
479- <ul id="<?php echo $taxonomy_name; ?>-search-checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
480- <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
481- <?php
482- $args['walker'] = $walker;
483- echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
484- ?>
485- <?php elseif ( is_wp_error( $search_results ) ) : ?>
486- <li><?php echo $search_results->get_error_message(); ?></li>
487- <?php elseif ( ! empty( $searched ) ) : ?>
488- <li><?php _e('No results found.'); ?></li>
489- <?php endif; ?>
490- </ul>
491- </div><!-- /.tabs-panel -->
492+ <ul id="<?php echo $taxonomy_name; ?>-search-checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
493+ <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
494+ <?php
495+ $args['walker'] = $walker;
496+ echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
497+ ?>
498+ <?php elseif ( is_wp_error( $search_results ) ) : ?>
499+ <li><?php echo $search_results->get_error_message(); ?></li>
500+ <?php elseif ( ! empty( $searched ) ) : ?>
501+ <li><?php _e('No results found.'); ?></li>
502+ <?php endif; ?>
503+ </ul>
504+ </div><!-- /.tabs-panel -->
505
506- <p class="button-controls">
507- <span class="list-controls">
508- <a href="<?php
509- echo esc_url(add_query_arg(
510- array(
511- $taxonomy_name . '-tab' => 'all',
512- 'selectall' => 1,
513- ),
514- remove_query_arg($removed_args)
515- ));
516- ?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
517- </span>
518-
519- <span class="add-to-menu">
520- <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-taxonomy-menu-item" id="<?php esc_attr_e( 'submit-taxonomy-' . $taxonomy_name ); ?>" />
521- <span class="spinner"></span>
522- </span>
523- </p>
524-
525- </div><!-- /.taxonomydiv -->
526+ <p class="button-controls">
527+ <span class="list-controls">
528+ <a href="<?php
529+ echo esc_url(add_query_arg(
530+ array(
531+ $taxonomy_name . '-tab' => 'all',
532+ 'selectall' => 1,
533+ ),
534+ remove_query_arg($removed_args)
535+ ));
536+ ?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
537+ </span>
538+ <span class="add-to-menu">
539+ <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-taxonomy-menu-item" id="submit-taxonomy-<?php echo $taxonomy_name; ?>" />
540+ <span class="spinner"></span>
541+ </span>
542+ </p>
543+ </div><!-- /.taxonomydiv -->
544+ </li>
545 <?php
546 }
547
548Index: wp-admin/js/nav-menu.js
549===================================================================
550--- wp-admin/js/nav-menu.js (revision 23452)
551+++ wp-admin/js/nav-menu.js (working copy)
552@@ -51,8 +51,6 @@
553 this.messageFadeIn();
554
555 this.initAccessibility();
556-
557- this.initToggles();
558 },
559
560 jQueryExtensions : function() {
561@@ -386,22 +384,6 @@
562 messages.slideDown( 'slow' );
563 },
564
565- initToggles : function() {
566- // init postboxes
567- postboxes.add_postbox_toggles('nav-menus');
568-
569- // adjust columns functions for menus UI
570- columns.useCheckboxesForHidden();
571- columns.checked = function(field) {
572- $('.field-' + field).removeClass('hidden-field');
573- }
574- columns.unchecked = function(field) {
575- $('.field-' + field).addClass('hidden-field');
576- }
577- // hide fields
578- api.menuList.hideAdvancedMenuItemFields();
579- },
580-
581 initSortables : function() {
582 var currentDepth = 0, originalDepth, minDepth, maxDepth,
583 prev, next, prevBottom, nextThreshold, helperHeight, transport,
584Index: wp-admin/nav-menus.php
585===================================================================
586--- wp-admin/nav-menus.php (revision 23452)
587+++ wp-admin/nav-menus.php (working copy)
588@@ -23,6 +23,7 @@
589 wp_die( __( 'Cheatin&#8217; uh?' ) );
590
591 wp_enqueue_script( 'nav-menu' );
592+wp_enqueue_script( 'accordion' );
593
594 if ( wp_is_mobile() )
595 wp_enqueue_script( 'jquery-touch-punch' );
596@@ -417,7 +418,6 @@
597
598 add_filter('admin_body_class', 'wp_nav_menu_max_depth');
599
600-wp_nav_menu_setup();
601 wp_initial_nav_menu_meta_boxes();
602
603 if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() )
604@@ -499,7 +499,11 @@
605 <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
606 <input type="hidden" name="action" value="add-menu-item" />
607 <?php wp_nonce_field( 'add-menu_item', 'menu-settings-column-nonce' ); ?>
608- <?php do_meta_boxes( 'nav-menus', 'side', null ); ?>
609+ <div id="side-sortables" class="accordion-container">
610+ <ul class="outer-border">
611+ <?php wp_nav_menu_setup(); ?>
612+ </ul>
613+ </div>
614 </form>
615
616 </div><!-- /#menu-settings-column -->
617Index: wp-admin/css/wp-admin.css
618===================================================================
619--- wp-admin/css/wp-admin.css (revision 23452)
620+++ wp-admin/css/wp-admin.css (working copy)
621@@ -6780,6 +6780,28 @@
622 display: block;
623 }
624
625+#nav-menu-meta ul.outer-border {
626+ border: 1px solid #eeeeee;
627+}
628+
629+.accordion-section ul.category-tabs,
630+.accordion-section ul.add-menu-item-tabs,
631+.accordion-section ul.wp-tab-bar {
632+ margin: 0;
633+}
634+
635+.accordion-section .categorychecklist {
636+ margin: 13px 0;
637+}
638+
639+#nav-menu-meta .accordion-section-content {
640+ padding: 18px 13px;
641+}
642+
643+#nav-menu-meta .button-controls {
644+ margin-bottom: 0;
645+}
646+
647 #nav-menus-frame {
648 margin-left: 300px;
649 margin-top: 28px;
650@@ -6979,7 +7001,8 @@
651 }
652
653 /* Add Menu Item Boxes */
654-.postbox .howto input {
655+.postbox .howto input,
656+.accordion-container .howto input {
657 width: 180px;
658 float: right;
659 }
660@@ -6988,6 +7011,10 @@
661 width: 200px;
662 }
663
664+.customlinkdiv p {
665+ margin-top: 0
666+}
667+
668 #nav-menu-theme-locations .howto select {
669 width: 100%;
670 }