Ticket #23119: 23119.28.1.diff
File 23119.28.1.diff, 61.5 KB (added by , 12 years ago) |
---|
-
wp-admin/css/colors-fresh.css
409 409 410 410 .submitbox .submitdelete:hover, 411 411 #media-items a.delete:hover, 412 #media-items a.delete-permanently:hover { 412 #media-items a.delete-permanently:hover, 413 #nav-menu-footer .menu-delete:hover { 413 414 color: #fff; 414 415 background-color: #f00; 415 416 border-bottom-color: #f00; -
wp-admin/css/wp-admin-rtl.css
44 44 25.0 - TinyMCE tweaks 45 45 26.0 - Full Overlay w/ Sidebar 46 46 27.0 - Customize Loader 47 28.0 - Nav Menus 48 29.0 - HiDPI 47 49 48 50 49 51 ------------------------------------------------------------------------------*/ … … 2303 2305 margin-right:0; 2304 2306 } 2305 2307 2306 .auto-add-pages {2307 float: right;2308 }2309 2310 2308 /* Star ratings */ 2311 2309 div.star-holder { 2312 2310 background: url('../images/stars-rtl.png?ver=20121108') repeat-x bottom right; … … 2534 2532 direction: ltr; 2535 2533 } 2536 2534 2537 /** 2538 * HiDPI Displays 2539 */ 2535 /*------------------------------------------------------------------------------ 2536 28.0 - Nav Menus 2537 ------------------------------------------------------------------------------*/ 2538 .js #menu-settings-column .postbox .handlediv::after { 2539 left: 15px; 2540 right: auto; 2541 } 2542 2543 .nav-menus-php .major-publishing-actions .publishing-action { 2544 float: left; 2545 } 2546 2547 .menu-settings dd { 2548 float: right; 2549 padding-right: 170px; 2550 } 2551 2552 .manage-menus span { 2553 float: right; 2554 } 2555 2556 .menu-settings dt { 2557 left: auto; 2558 right: 0; 2559 } 2560 2561 .menu-settings dd input, 2562 .menu-settings dd span, 2563 .menu-settings dd label, 2564 .manage-menus select { 2565 float: right; 2566 margin-right: 6px; 2567 } 2568 2569 /*------------------------------------------------------------------------------ 2570 29.0 - HiDPI 2571 ------------------------------------------------------------------------------*/ 2540 2572 @media print, 2541 2573 (-o-min-device-pixel-ratio: 5/4), 2542 2574 (-webkit-min-device-pixel-ratio: 1.25), -
wp-admin/css/wp-admin.css
2433 2433 .fixed .column-categories, 2434 2434 .fixed .column-tags, 2435 2435 .fixed .column-rel, 2436 .fixed .column-role { 2436 .fixed .column-role, 2437 .fixed .column-count { 2437 2438 width: 15%; 2438 2439 } 2439 2440 … … 6760 6761 6761 6762 /* nav-menu */ 6762 6763 6764 .nav-menus-php #message { 6765 display: none; 6766 } 6767 6768 .nav-menus-php .nav-tab-wrapper { 6769 margin-bottom: 20px; 6770 } 6771 6763 6772 #nav-menus-frame { 6764 6773 margin-left: 300px; 6774 margin-top: 20px; 6765 6775 } 6766 6776 6767 6777 #wpbody-content #menu-settings-column { … … 6770 6780 margin-left: -300px; 6771 6781 clear: both; 6772 6782 float: left; 6773 padding-top: 24px; 6783 padding-top: 0; 6784 -webkit-border-radius: 3px; 6785 border-radius: 3px; 6786 margin-bottom: 20px; 6774 6787 } 6775 6788 6789 #menu-settings-column h3 { 6790 padding: 9px 10px 12px; 6791 } 6792 6793 #menu-settings-column { 6794 border-top: 1px solid #dfdfdf; 6795 } 6796 6797 #menu-settings-column h3 { 6798 color: #fff; 6799 text-shadow: 0 -1px 0 #333; 6800 background: #808080; 6801 background-image: -webkit-gradient(linear, left bottom, left top, from(#7d7d7d), to(#909090)); 6802 background-image: -webkit-linear-gradient(bottom, #7d7d7d, #909090); 6803 background-image: -moz-linear-gradient(bottom, #7d7d7d, #909090); 6804 background-image: -o-linear-gradient(bottom, #7d7d7d, #909090); 6805 background-image: linear-gradient(to top, #7d7d7d, #909090); 6806 } 6807 6808 #menu-settings-column .closed h3 { 6809 color: #464646; 6810 text-shadow: 0 -1px 0 #f9f9f9; 6811 background: #f1f1f1; 6812 background-image: -webkit-gradient(linear, left bottom, left top, from(#ececec), to(#f9f9f9)); 6813 background-image: -webkit-linear-gradient(bottom, #ececec, #f9f9f9); 6814 background-image: -moz-linear-gradient(bottom, #ececec, #f9f9f9); 6815 background-image: -o-linear-gradient(bottom, #ececec, #f9f9f9); 6816 background-image: linear-gradient(to top, #ececec, #f9f9f9); 6817 border: solid #dfdfdf; 6818 border-width: 0 1px 1px; 6819 } 6820 6776 6821 .no-js #wpbody-content #menu-settings-column { 6777 6822 padding-top: 31px; 6778 6823 } 6779 6824 6780 6825 #menu-settings-column .inside { 6826 background: #fbfbfb; 6781 6827 clear: both; 6782 margin: 10px 0 0; 6828 margin: 0; 6829 border-left: 1px solid #dfdfdf; 6830 border-right: 1px solid #dfdfdf; 6831 border-bottom: 1px solid #d2d2d2; 6832 padding-top: 8px; 6783 6833 } 6784 6834 6835 #menu-settings-column .postbox .hndle { 6836 -webkit-border-radius: 0; 6837 border-radius: 0; 6838 cursor: pointer; 6839 border-bottom: none; 6840 } 6841 6842 #menu-settings-column .closed .hndle { 6843 border-bottom: 1px solid #dfdfdf; 6844 } 6845 6846 #menu-settings-column .postbox { 6847 border: none; 6848 margin-bottom: 0; 6849 -webkit-border-radius: 0; 6850 border-radius: 0; 6851 } 6852 6853 .js #menu-settings-column .postbox .handlediv { 6854 background: none; 6855 } 6856 6857 .js #menu-settings-column .postbox .handlediv::after { 6858 content: ''; 6859 width: 0; 6860 height: 0; 6861 border-color: #ccc transparent; 6862 border-style: solid; 6863 border-width: 6px 6px 0; 6864 position: absolute; 6865 top: 15px; 6866 right: 20px; 6867 z-index: 1; 6868 } 6869 6785 6870 .metabox-holder-disabled .postbox { 6786 6871 opacity: 0.5; 6787 6872 filter: alpha(opacity=50); … … 6795 6880 position: relative; 6796 6881 } 6797 6882 6883 .blank-slate br { 6884 display: none; 6885 } 6886 6887 .blank-slate .menu-name { 6888 height: 2em; 6889 } 6890 6891 .blank-slate .menu-settings { 6892 border: none; 6893 margin-top: 0; 6894 padding-top: 0; 6895 overflow: hidden; 6896 } 6897 6898 .is-submenu { 6899 color: #999; 6900 font-style: italic; 6901 font-weight: normal; 6902 margin-left: 4px; 6903 } 6904 6905 .manage-menus { 6906 border: 1px solid #eee; 6907 background: #fbfbfb; 6908 margin-top: 13px; 6909 padding: 10px; 6910 overflow: hidden; 6911 -webkit-border-radius: 3px; 6912 border-radius: 3px; 6913 } 6914 6915 .manage-menus select { 6916 float: left; 6917 min-width: 180px; 6918 } 6919 6920 .manage-menus .spinner { 6921 float: left; 6922 } 6923 6924 .manage-menus span { 6925 float: left; 6926 margin: 4px 6px 0 0; 6927 } 6928 6929 .menu-edit p { 6930 margin: .3em 0 .6em; 6931 } 6932 6933 .menu-settings { 6934 border-top: 1px solid #eee; 6935 margin-top: 2em; 6936 padding-top: 16px; 6937 overflow: hidden; 6938 } 6939 6940 .menu-settings dl { 6941 margin: 0 0 10px; 6942 overflow: hidden; 6943 position: relative; 6944 } 6945 6946 .menu-settings dd { 6947 float: left; 6948 margin: 0; 6949 width: 60%; 6950 padding-left: 170px; 6951 } 6952 6953 .menu-settings dt { 6954 clear: both; 6955 left: 0; 6956 padding: 3px 0 0; 6957 position: absolute; 6958 } 6959 6960 .menu-edit .checkbox-input { 6961 margin-top: 4px; 6962 } 6963 6964 .theme-location-set { 6965 color: #999; 6966 font-size: 11px; 6967 } 6968 6798 6969 /* Menu Container */ 6799 6970 #menu-management-liquid { 6800 6971 float: left; 6801 6972 min-width: 100%; 6973 margin-top: 3px; 6802 6974 } 6803 6975 6804 6976 #menu-management { … … 6812 6984 margin-bottom: 20px; 6813 6985 } 6814 6986 6987 #menu-management p.search-box { 6988 margin: 5px 0; 6989 } 6990 6815 6991 .nav-menus-php #post-body { 6816 padding: 10px;6992 padding: 0 10px; 6817 6993 border-width: 1px 0; 6818 6994 border-style: solid; 6819 6995 } … … 6825 7001 6826 7002 #nav-menu-header { 6827 7003 border-bottom: 1px solid; 7004 margin-bottom: 13px; 6828 7005 } 6829 7006 7007 #nav-menu-header .menu-name-label { 7008 margin-top: 2px; 7009 } 7010 6830 7011 #nav-menu-footer { 6831 7012 border-top: 1px solid; 6832 7013 } … … 6845 7026 font-weight:bold; 6846 7027 } 6847 7028 6848 /* Menu Tabs */6849 6850 #menu-management .nav-tabs-nav {6851 margin: 0 20px;6852 }6853 6854 #menu-management .nav-tabs-arrow {6855 width: 10px;6856 padding: 0 5px 4px;6857 cursor: pointer;6858 position: absolute;6859 top: 0;6860 line-height: 22px;6861 font-size: 18px;6862 text-shadow: 0 1px 0 #fff;6863 }6864 6865 #menu-management .nav-tabs-arrow-left {6866 left: 0;6867 }6868 6869 #menu-management .nav-tabs-arrow-right {6870 right: 0;6871 text-align: right;6872 }6873 6874 #menu-management .nav-tabs-wrapper {6875 width: 100%;6876 height: 28px;6877 margin-bottom: -1px;6878 overflow: hidden;6879 }6880 6881 #menu-management .nav-tabs {6882 padding-left: 20px;6883 padding-right: 10px;6884 }6885 6886 .js #menu-management .nav-tabs {6887 float: left;6888 margin-left: 0px;6889 margin-right: -400px;6890 }6891 6892 #menu-management .nav-tab {6893 margin-bottom: 0;6894 font-size: 14px;6895 }6896 6897 7029 #select-nav-menu-container { 6898 7030 text-align: right; 6899 7031 padding: 0 10px 3px 10px; … … 7090 7222 } 7091 7223 7092 7224 #menu-to-edit { 7093 padding: 1em 0; 7225 margin: 0; 7226 padding: 0.1em 0; 7094 7227 } 7095 7228 7096 7229 .menu ul { … … 7106 7239 clear:both; 7107 7240 line-height:1.5em; 7108 7241 position:relative; 7109 margin: 13px 00 0;7242 margin: 9px 0 0; 7110 7243 } 7111 7244 7112 7245 .menu-item-handle { … … 7333 7466 text-align: right; 7334 7467 float: right; 7335 7468 line-height: 23px; 7336 margin: 5px 0 1px;7469 margin: 2px 0 1px; 7337 7470 } 7338 7471 7339 .nav-menus-php .major-publishing-actions .delete-action { 7340 vertical-align: middle; 7341 text-align: left; 7342 float: left; 7343 padding-right: 15px; 7344 margin-top: 5px; 7472 .nav-menus-php .delete-action a { 7473 color: #bc0b0b; 7345 7474 } 7346 7475 7347 .menu-name-label span, 7348 .auto-add-pages label { 7349 font-size: 12px; 7350 font-style: normal; 7476 .nav-menus-php .blank-slate .auto-add-pages, 7477 .nav-menus-php .blank-slate dt, 7478 .nav-menus-php .blank-slate .auto-add-pages, 7479 .nav-menus-php .blank-slate .menu-theme-locations { 7480 display: none; 7351 7481 } 7352 7482 7353 . menu-name-label{7354 margin-right: 15px;7483 .nav-menus-php .blank-slate dd { 7484 padding: 0; 7355 7485 } 7356 7486 7357 .auto-add-pages input { 7358 margin-top: 0; 7359 } 7360 7361 .auto-add-pages { 7362 margin-top: 4px; 7487 .nav-menus-php .delete-action { 7363 7488 float: left; 7489 margin-top: 2px; 7364 7490 } 7365 7491 7366 7492 .nav-menus-php .submitbox .submitcancel { -
wp-admin/includes/nav-menu.php
81 81 82 82 $title = empty( $item->label ) ? $title : $item->label; 83 83 84 $submenu_text = ''; 85 if (0 == $depth) 86 $submenu_text = 'style="display: none;"'; 87 84 88 ?> 85 89 <li id="menu-item-<?php echo $item_id; ?>" class="<?php echo implode(' ', $classes ); ?>"> 86 90 <dl class="menu-item-bar"> 87 91 <dt class="menu-item-handle"> 88 <span class="item-title"><?php echo esc_html( $title ); ?> </span>92 <span class="item-title"><?php echo esc_html( $title ); ?> <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item' ); ?></span></span> 89 93 <span class="item-controls"> 90 94 <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span> 91 95 <span class="item-order hide-if-js"> … … 186 190 ), 187 191 'delete-menu_item_' . $item_id 188 192 ); ?>"><?php _e('Remove'); ?></a> <span class="meta-sep"> | </span> <a class="item-cancel submitcancel" id="cancel-<?php echo $item_id; ?>" href="<?php echo esc_url( add_query_arg( array('edit-menu-item' => $item_id, 'cancel' => time()), remove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) ) ) ); 189 ?>#menu-item-settings-<?php echo $item_id; ?>"><?php _e(' Cancel'); ?></a>193 ?>#menu-item-settings-<?php echo $item_id; ?>"><?php _e('Reset'); ?></a> 190 194 </div> 191 195 192 196 <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" /> … … 382 386 **/ 383 387 function wp_nav_menu_setup() { 384 388 // Register meta boxes 385 if ( wp_get_nav_menus() )386 add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' );387 add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );389 //if ( wp_get_nav_menus() ) 390 // add_meta_box( 'nav-menu-theme-locations', __( 'Menus within your theme' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' ); 391 // todo: if we stick with the theme location checkboxes then remove the metabox code all togehter 388 392 wp_nav_menu_post_type_meta_boxes(); 393 add_meta_box( 'add-custom-links', __('Add Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); 389 394 wp_nav_menu_taxonomy_meta_boxes(); 390 395 391 396 // Register advanced menu items (columns) … … 411 416 if ( get_user_option( 'metaboxhidden_nav-menus' ) !== false || ! is_array($wp_meta_boxes) ) 412 417 return; 413 418 414 $initial_meta_boxes = array( 'nav-menu-theme-locations', 'add- custom-links', 'add-page', 'add-category' );419 $initial_meta_boxes = array( 'nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category' ); 415 420 $hidden_meta_boxes = array(); 416 421 417 422 foreach ( array_keys($wp_meta_boxes['nav-menus']) as $context ) { … … 445 450 $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); 446 451 if ( $post_type ) { 447 452 $id = $post_type->name; 448 add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );453 add_meta_box( "add-{$id}", __('Add ') . $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type ); 449 454 } 450 455 } 451 456 } … … 465 470 $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); 466 471 if ( $tax ) { 467 472 $id = $tax->name; 468 add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax );473 add_meta_box( "add-{$id}", __('Add ') . $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax ); 469 474 } 470 475 } 471 476 } … … 489 494 $menu_locations = get_nav_menu_locations(); 490 495 $num_locations = count( array_keys($locations) ); 491 496 492 echo '<p class="howto">' . sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n($num_locations)) . '</p>';497 echo '<p class="howto">' . _n('Select a menu to use within your theme.', 'Select the menus you will use in your theme.', $num_locations ) . '</p>'; 493 498 494 499 foreach ( $locations as $location => $description ) { 495 500 ?> … … 512 517 } 513 518 ?> 514 519 <p class="button-controls"> 515 <?php submit_button( __( 'Save' ), 'primary right', 'nav-menu-locations', false, disabled( $nav_menu_selected_id, 0, false) ); ?>520 <?php submit_button( __( 'Save' ), 'primary right', 'nav-menu-locations', false, wp_nav_menu_disabled_check( $nav_menu_selected_id ) ); ?> 516 521 <span class="spinner"></span> 517 522 </p> 518 523 <?php 519 524 } 520 525 526 function wp_nav_menu_disabled_check( $nav_menu_selected_id ) { 527 global $one_theme_location_no_menus; 528 529 if ( $one_theme_location_no_menus ) 530 return false; 531 532 return disabled( $nav_menu_selected_id, 0 ); 533 } 534 521 535 /** 522 536 * Displays a metabox for the custom links menu item. 523 537 * … … 554 568 555 569 <p id="menu-item-name-wrap"> 556 570 <label class="howto" for="custom-menu-item-name"> 557 <span><?php _e('L abel'); ?></span>571 <span><?php _e('Link Text'); ?></span> 558 572 <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'); ?>" /> 559 573 </label> 560 574 </p> 561 575 562 576 <p class="button-controls"> 563 577 <span class="add-to-menu"> 564 <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-custom-menu-item" id="submit-customlinkdiv" />578 <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" /> 565 579 <span class="spinner"></span> 566 580 </span> 567 581 </p> … … 779 793 </span> 780 794 781 795 <span class="add-to-menu"> 782 <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; ?>" />796 <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="submit-posttype-<?php echo $post_type_name; ?>" /> 783 797 <span class="spinner"></span> 784 798 </span> 785 799 </p> … … 955 969 </span> 956 970 957 971 <span class="add-to-menu"> 958 <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; ?>" />972 <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="submit-taxonomy-<?php echo $taxonomy_name; ?>" /> 959 973 <span class="spinner"></span> 960 974 </span> 961 975 </p> … … 1084 1098 // If the menu exists, get its items. 1085 1099 if ( is_nav_menu( $menu ) ) { 1086 1100 $menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') ); 1087 $result = '<div id="menu-instructions" class="post-body-plain'; 1101 $result = '<div id="menu-instructions" class="post-body-plain'; 1088 1102 $result .= ( ! empty($menu_items) ) ? ' menu-instructions-inactive">' : '">'; 1089 $result .= '<p>' . __(' Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.') . '</p>';1090 $result .= '</div>'; 1103 $result .= '<p>' . __('Next, add menu items (i.e. pages, links, categories) from the column on the left.') . '</p>'; 1104 $result .= '</div>'; 1091 1105 1092 1106 if( empty($menu_items) ) 1093 1107 return $result . ' <ul class="menu" id="menu-to-edit"> </ul>'; … … 1158 1172 foreach( (array) $menu_items_to_delete as $menu_item_id ) 1159 1173 wp_delete_post( $menu_item_id, true ); 1160 1174 } 1175 add_action('admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items'); 1161 1176 1162 add_action('admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items'); 1177 /** 1178 * Delete nav menus from the nav menu management screen 1179 * 1180 * @access private 1181 * @since 3.6 1182 */ 1183 function _wp_delete_nav_menu( $nav_menu_id ) { 1184 1185 if ( ! is_nav_menu( $nav_menu_id ) ) 1186 return; 1187 1188 $deleted_nav_menu = wp_get_nav_menu_object( $nav_menu_id ); 1189 $delete_nav_menu = wp_delete_nav_menu( $nav_menu_id ); 1190 1191 if ( is_wp_error( $delete_nav_menu ) ) 1192 return $delete_nav_menu; 1193 1194 // Remove this menu from any locations. 1195 $locations = get_theme_mod( 'nav_menu_locations' ); 1196 foreach ( (array) $locations as $location => $menu_id ) { 1197 if ( $menu_id == $nav_menu_id ) 1198 $locations[ $location ] = 0; 1199 } 1200 set_theme_mod( 'nav_menu_locations', $locations ); 1201 return true; 1202 } 1203 1204 /** 1205 * Saves nav menu items 1206 * 1207 * @since 3.6 1208 */ 1209 function wp_nav_menu_update_menu_items ($nav_menu_selected_id, $nav_menu_selected_title) { 1210 $unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID', 'post_status' => 'draft,publish') ); 1211 1212 $menu_items = array(); 1213 // Index menu items by db ID 1214 foreach( $unsorted_menu_items as $_item ) 1215 $menu_items[$_item->db_id] = $_item; 1216 1217 $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' ); 1218 wp_defer_term_counting(true); 1219 // Loop through all the menu items' POST variables 1220 if ( ! empty( $_POST['menu-item-db-id'] ) ) { 1221 foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) { 1222 1223 // Menu item title can't be blank 1224 if ( empty( $_POST['menu-item-title'][$_key] ) ) 1225 continue; 1226 1227 $args = array(); 1228 foreach ( $post_fields as $field ) 1229 $args[$field] = isset( $_POST[$field][$_key] ) ? $_POST[$field][$_key] : ''; 1230 1231 $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args ); 1232 1233 if ( is_wp_error( $menu_item_db_id ) ) 1234 $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>'; 1235 elseif ( isset( $menu_items[$menu_item_db_id] ) ) 1236 unset( $menu_items[$menu_item_db_id] ); 1237 } 1238 } 1239 1240 // Remove menu items from the menu that weren't in $_POST 1241 if ( ! empty( $menu_items ) ) { 1242 foreach ( array_keys( $menu_items ) as $menu_item_id ) { 1243 if ( is_nav_menu_item( $menu_item_id ) ) { 1244 wp_delete_post( $menu_item_id ); 1245 } 1246 } 1247 } 1248 1249 // Store 'auto-add' pages. 1250 $auto_add = ! empty( $_POST['auto-add-pages'] ); 1251 $nav_menu_option = (array) get_option( 'nav_menu_options' ); 1252 if ( ! isset( $nav_menu_option['auto_add'] ) ) 1253 $nav_menu_option['auto_add'] = array(); 1254 if ( $auto_add ) { 1255 if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) 1256 $nav_menu_option['auto_add'][] = $nav_menu_selected_id; 1257 } else { 1258 if ( false !== ( $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) ) 1259 unset( $nav_menu_option['auto_add'][$key] ); 1260 } 1261 // Remove nonexistent/deleted menus 1262 $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) ); 1263 update_option( 'nav_menu_options', $nav_menu_option ); 1264 1265 wp_defer_term_counting(false); 1266 1267 do_action( 'wp_update_nav_menu', $nav_menu_selected_id ); 1268 1269 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __('<strong>%1$s</strong> has been updated.'), $nav_menu_selected_title ) . '</p></div>'; 1270 unset( $menu_items, $unsorted_menu_items ); 1271 1272 return $messages; 1273 } 1274 No newline at end of file -
wp-admin/js/nav-menu.js
45 45 if( api.menuList.length ) // If no menu, we're in the + tab. 46 46 this.initSortables(); 47 47 48 if( oneThemeLocationNoMenus ) 49 $('#posttype-page').addSelectedToMenu( api.addMenuItemToBottom ); 50 51 this.messageFadeIn(); 52 53 this.initSelectMenuDropdown(); 54 this.initAccessibility(); 55 48 56 this.initToggles(); 49 50 this.initTabManager();51 57 }, 52 58 53 59 jQueryExtensions : function() { … … 84 90 }); 85 91 return result; 86 92 }, 93 shiftHorizontally : function(dir) { 94 return this.each(function(){ 95 var t = $(this), 96 depth = t.menuItemDepth(), 97 newDepth = depth + dir; 98 99 // Change .menu-item-depth-n class 100 t.moveHorizontally(newDepth, depth); 101 }); 102 }, 103 moveHorizontally : function(newDepth, depth) { 104 return this.each(function(){ 105 var t = $(this), 106 children = t.childMenuItems(), 107 diff = newDepth - depth, 108 subItemText = t.find('.is-submenu'); 109 110 // Change .menu-item-depth-n class 111 t.updateDepthClass(newDepth, depth).updateParentMenuItemDBId(); 112 113 // If it has children, move those too 114 if (children) { 115 children.each(function( index ) { 116 var thisDepth = $(this).menuItemDepth(), 117 newDepth = thisDepth + diff; 118 $(this).updateDepthClass(newDepth, thisDepth).updateParentMenuItemDBId(); 119 }); 120 } 121 122 // Show "Sub item" helper text 123 if (0 === newDepth) 124 subItemText.hide(); 125 else 126 subItemText.show(); 127 }); 128 }, 87 129 updateParentMenuItemDBId : function() { 88 130 return this.each(function(){ 89 131 var item = $(this), 90 132 input = item.find('.menu-item-data-parent-id'), 91 depth = item.menuItemDepth(), 92 parent = item.prev(); 133 depth = parseInt(item.menuItemDepth()), 134 parentDepth = depth - 1; 135 parent = item.prevAll('.menu-item-depth-' + parentDepth).first(); 93 136 94 137 if( depth == 0 ) { // Item is on the top level, has no parent 95 138 input.val(0); 96 139 } else { // Find the parent item, and retrieve its object id. 97 while( ! parent[0] || ! parent[0].className || -1 == parent[0].className.indexOf('menu-item') || ( parent.menuItemDepth() != depth - 1 ) )98 parent = parent.prev();99 140 input.val( parent.find('.menu-item-data-db-id').val() ); 100 141 } 101 142 }); … … 120 161 121 162 return this.each(function() { 122 163 var t = $(this), menuItems = {}, 123 checkboxes = t.find('.tabs-panel-active .categorychecklist li input:checked'),164 checkboxes = ( oneThemeLocationNoMenus && 0 == t.find('.tabs-panel-active .categorychecklist li input:checked').length ) ? t.find('#page-all li input[type="checkbox"]') : t.find('.tabs-panel-active .categorychecklist li input:checked'), 124 165 re = new RegExp('menu-item\\[(\[^\\]\]*)'); 125 166 126 167 processMethod = processMethod || api.addMenuItemToBottom; … … 222 263 } 223 264 }); 224 265 }, 266 267 initSelectMenuDropdown : function () { 268 var menuSelector = $('.manage-menus select'); 225 269 270 menuSelector.on('change', function () { 271 var url = $(this).val(); 272 273 if (url && '--' !== url) { 274 $('.menu-selector .spinner').show(); 275 window.location = url; 276 } 277 }); 278 }, 279 280 initAccessibility : function() { 281 $('.item-edit').off('focus').on('focus', function () { 282 $(this).on('keydown', function (e) { 283 284 // Bail if it's not an arrow key 285 if (e.which !== 37 && e.which !== 38 && e.which !== 39 && e.which !== 40) 286 return; 287 288 // Avoid multiple keydown events 289 $(this).off('keydown'); 290 291 var menuItems = $('#menu-to-edit li'); 292 menuItemsCount = menuItems.length, 293 thisItem = $(this).parents('li.menu-item'), 294 thisItemChildren = thisItem.childMenuItems(), 295 thisItemData = thisItem.getItemData(), 296 thisItemDepth = parseInt(thisItem.menuItemDepth()), 297 thisItemPosition = parseInt(thisItem.index()), 298 nextItem = thisItem.next(), 299 nextItemChildren = nextItem.childMenuItems(), 300 nextItemDepth = parseInt(nextItem.menuItemDepth()) + 1, 301 prevItem = thisItem.prev(), 302 prevItemDepth = parseInt(prevItem.menuItemDepth()), 303 prevItemId = prevItem.getItemData()['menu-item-db-id']; 304 305 // Bail if there is only one menu item 306 if (1 === menuItemsCount) 307 return; 308 309 // If RTL, swap left/right arrows 310 var arrows = { '38' : 'up', '40' : 'down', '37' : 'left', '39' : 'right' }; 311 if ($('body').hasClass('rtl')) 312 arrows = { '38' : 'up', '40' : 'down', '39' : 'left', '37' : 'right' }; 313 314 switch (arrows[e.which]) { 315 case 'up': 316 var newItemPosition = thisItemPosition - 1; 317 318 // Already at top 319 if (0 === thisItemPosition) 320 break; 321 322 // If a sub item is moved to top, shift it to 0 depth 323 if (0 === newItemPosition && 0 !== thisItemDepth) 324 thisItem.moveHorizontally(0, thisItemDepth); 325 326 // If prev item is sub item, shift to match depth 327 if (0 !== prevItemDepth) 328 thisItem.moveHorizontally(prevItemDepth, thisItemDepth); 329 330 // Does this item have sub items? 331 if (thisItemChildren) { 332 var items = thisItem.add(thisItemChildren); 333 // Move the entire block 334 items.detach().insertBefore(menuItems.eq(newItemPosition)); 335 } else { 336 thisItem.detach().insertBefore(menuItems.eq(newItemPosition)); 337 } 338 break; 339 case 'down': 340 // Does this item have sub items? 341 if (thisItemChildren) { 342 var items = thisItem.add(thisItemChildren), 343 nextItem = menuItems.eq(items.length + thisItemPosition), 344 nextItemChildren = 0 !== nextItem.childMenuItems().length; 345 346 if (nextItemChildren) { 347 var newDepth = parseInt(nextItem.menuItemDepth()) + 1; 348 thisItem.moveHorizontally(newDepth, thisItemDepth); 349 } 350 351 // Have we reached the bottom? 352 if (menuItemsCount === thisItemPosition + items.length) 353 break; 354 355 items.detach().insertAfter(menuItems.eq(thisItemPosition + items.length)); 356 } else { 357 // If next item has sub items, shift depth 358 if (0 !== nextItemChildren.length) 359 thisItem.moveHorizontally(nextItemDepth, thisItemDepth); 360 361 // Have we reached the bottom 362 if (menuItemsCount === thisItemPosition + 1) 363 break; 364 thisItem.detach().insertAfter(menuItems.eq(thisItemPosition + 1)); 365 } 366 break; 367 case 'left': 368 // As far left as possible 369 if (0 === thisItemDepth) 370 break; 371 thisItem.shiftHorizontally(-1); 372 break; 373 case 'right': 374 // Can't be sub item at top 375 if (0 === thisItemPosition) 376 break; 377 // Already sub item of prevItem 378 if (thisItemData['menu-item-parent-id'] === prevItemId) 379 break; 380 thisItem.shiftHorizontally(1); 381 break; 382 } 383 api.registerChange(); 384 // Put focus back on same menu item 385 $('#edit-' + thisItemData['menu-item-db-id']).focus(); 386 return false; 387 }); 388 }).blur(function () { 389 $(this).off('keydown'); 390 }); 391 }, 392 393 messageFadeIn : function() { 394 var messages = $('#message'); 395 396 // Visual change when users save menus multiple times in a row 397 messages.slideDown('slow'); 398 }, 399 400 hideAllMetaBoxes : function(el) { 401 el.addClass('closed'); 402 }, 403 404 showMetaBox : function(el) { 405 el.removeClass('closed'); 406 }, 407 226 408 initToggles : function() { 227 409 // init postboxes 228 410 postboxes.add_postbox_toggles('nav-menus'); 411 412 // Hide all visible .postbox 413 var pboxes = $('.postbox'); 414 api.hideAllMetaBoxes(pboxes); 415 416 // Show first .postbox 417 api.showMetaBox($('.postbox:visible').first()); 229 418 419 // Show on click and hide all others 420 pboxes.on('click', function () { 421 api.hideAllMetaBoxes(pboxes); 422 api.showMetaBox($(this)); 423 }); 424 425 // Show when adding from screen options 426 $('.hide-postbox-tog').on('click', function () { 427 api.hideAllMetaBoxes(pboxes); 428 if ($(this).prop('checked')) 429 api.showMetaBox($('#' + $(this).val())); 430 else 431 api.showMetaBox($('.postbox:visible').first()); 432 }); 433 230 434 // adjust columns functions for menus UI 231 435 columns.useCheckboxesForHidden(); 232 436 columns.checked = function(field) { … … 236 440 $('.field-' + field).addClass('hidden-field'); 237 441 } 238 442 // hide fields 239 api.menuList.hideAdvancedMenuItemFields(); 443 api.menuList.hideAdvancedMenuItemFields(); 240 444 }, 241 445 242 446 initSortables : function() { … … 245 449 menuEdge = api.menuList.offset().left, 246 450 body = $('body'), maxChildDepth, 247 451 menuMaxDepth = initialMenuMaxDepth(); 452 453 if( 0 != $('#menu-to-edit li').length ) 454 $('.drag-instructions').show(); 248 455 249 456 // Use the right edge if RTL. 250 457 menuEdge += api.isRTL ? api.menuList.width() : 0; … … 307 514 308 515 // Return child elements to the list 309 516 children = transport.children().insertAfter(ui.item); 517 518 // Add "sub menu" description 519 var subMenuTitle = ui.item.find('.item-title .is-submenu'); 520 if (0 < currentDepth) 521 subMenuTitle.show(); 522 else 523 subMenuTitle.hide(); 310 524 311 525 // Update depth classes 312 526 if( depthChange != 0 ) { … … 327 541 ui.item[0].style.left = 'auto'; 328 542 ui.item[0].style.right = 0; 329 543 } 330 331 // The width of the tab bar might have changed. Just in case.332 api.refreshMenuTabs( true );333 544 }, 334 545 change: function(e, ui) { 335 546 // Make sure the placeholder is inside the menu. … … 461 672 if( '' == $t.val() ) 462 673 $t.addClass( name ).val( $t.data(name) ); 463 674 }); 675 676 $('.blank-slate .input-with-default-title').focus(); 464 677 }, 465 678 466 679 attachThemeLocationsListeners : function() { … … 572 785 $.post( ajaxurl, params, function(menuMarkup) { 573 786 var ins = $('#menu-instructions'); 574 787 processMethod(menuMarkup, params); 788 // Make it stand out a bit more visually, by adding a fadeIn 789 $('li.pending').hide().fadeIn('slow'); 790 $('.drag-instructions').show(); 575 791 if( ! ins.hasClass('menu-instructions-inactive') && ins.siblings().length ) 576 792 ins.addClass('menu-instructions-inactive'); 577 793 callback(); … … 586 802 */ 587 803 addMenuItemToBottom : function( menuMarkup, req ) { 588 804 $(menuMarkup).hideAdvancedMenuItemFields().appendTo( api.targetList ); 805 api.initAccessibility(); 589 806 }, 590 807 591 808 addMenuItemToTop : function( menuMarkup, req ) { 592 809 $(menuMarkup).hideAdvancedMenuItemFields().prependTo( api.targetList ); 810 api.initAccessibility(); 593 811 }, 594 812 595 813 attachUnsavedChangesListener : function() { … … 604 822 }; 605 823 } else { 606 824 // Make the post boxes read-only, as they can't be used yet 607 $('#menu-settings-column').find('input,select'). prop('disabled', true).end().find('a').attr('href', '#').unbind('click');825 $('#menu-settings-column').find('input,select').end().find('a').attr('href', '#').unbind('click'); 608 826 } 609 827 }, 610 828 … … 688 906 }); 689 907 }, 690 908 691 initTabManager : function() {692 var fixed = $('.nav-tabs-wrapper'),693 fluid = fixed.children('.nav-tabs'),694 active = fluid.children('.nav-tab-active'),695 tabs = fluid.children('.nav-tab'),696 tabsWidth = 0,697 fixedRight, fixedLeft,698 arrowLeft, arrowRight, resizeTimer, css = {},699 marginFluid = api.isRTL ? 'margin-right' : 'margin-left',700 marginFixed = api.isRTL ? 'margin-left' : 'margin-right',701 msPerPx = 2;702 703 /**704 * Refreshes the menu tabs.705 * Will show and hide arrows where necessary.706 * Scrolls to the active tab by default.707 *708 * @param savePosition {boolean} Optional. Prevents scrolling so709 * that the current position is maintained. Default false.710 **/711 api.refreshMenuTabs = function( savePosition ) {712 var fixedWidth = fixed.width(),713 margin = 0, css = {};714 fixedLeft = fixed.offset().left;715 fixedRight = fixedLeft + fixedWidth;716 717 if( !savePosition )718 active.makeTabVisible();719 720 // Prevent space from building up next to the last tab if there's more to show721 if( tabs.last().isTabVisible() ) {722 margin = fixed.width() - tabsWidth;723 margin = margin > 0 ? 0 : margin;724 css[marginFluid] = margin + 'px';725 fluid.animate( css, 100, "linear" );726 }727 728 // Show the arrows only when necessary729 if( fixedWidth > tabsWidth )730 arrowLeft.add( arrowRight ).hide();731 else732 arrowLeft.add( arrowRight ).show();733 }734 735 $.fn.extend({736 makeTabVisible : function() {737 var t = this.eq(0), left, right, css = {}, shift = 0;738 739 if( ! t.length ) return this;740 741 left = t.offset().left;742 right = left + t.outerWidth();743 744 if( right > fixedRight )745 shift = fixedRight - right;746 else if ( left < fixedLeft )747 shift = fixedLeft - left;748 749 if( ! shift ) return this;750 751 css[marginFluid] = "+=" + api.negateIfRTL * shift + 'px';752 fluid.animate( css, Math.abs( shift ) * msPerPx, "linear" );753 return this;754 },755 isTabVisible : function() {756 var t = this.eq(0),757 left = t.offset().left,758 right = left + t.outerWidth();759 return ( right <= fixedRight && left >= fixedLeft ) ? true : false;760 }761 });762 763 // Find the width of all tabs764 tabs.each(function(){765 tabsWidth += $(this).outerWidth(true);766 });767 768 // Set up fixed margin for overflow, unset padding769 css['padding'] = 0;770 css[marginFixed] = (-1 * tabsWidth) + 'px';771 fluid.css( css );772 773 // Build tab navigation774 arrowLeft = $('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>«</a></div>');775 arrowRight = $('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>»</a></div>');776 // Attach to the document777 fixed.wrap('<div class="nav-tabs-nav"/>').parent().prepend( arrowLeft ).append( arrowRight );778 779 // Set the menu tabs780 api.refreshMenuTabs();781 // Make sure the tabs reset on resize782 $(window).resize(function() {783 if( resizeTimer ) clearTimeout(resizeTimer);784 resizeTimer = setTimeout( api.refreshMenuTabs, 200);785 });786 787 // Build arrow functions788 $.each([{789 arrow : arrowLeft,790 next : "next",791 last : "first",792 operator : "+="793 },{794 arrow : arrowRight,795 next : "prev",796 last : "last",797 operator : "-="798 }], function(){799 var that = this;800 this.arrow.mousedown(function(){801 var marginFluidVal = Math.abs( parseInt( fluid.css(marginFluid) ) ),802 shift = marginFluidVal,803 css = {};804 805 if( "-=" == that.operator )806 shift = Math.abs( tabsWidth - fixed.width() ) - marginFluidVal;807 808 if( ! shift ) return;809 810 css[marginFluid] = that.operator + shift + 'px';811 fluid.animate( css, shift * msPerPx, "linear" );812 }).mouseup(function(){813 var tab, next;814 fluid.stop(true);815 tab = tabs[that.last]();816 while( (next = tab[that.next]()) && next.length && ! next.isTabVisible() ) {817 tab = next;818 }819 tab.makeTabVisible();820 });821 });822 },823 824 909 eventOnClickEditLink : function(clickedEl) { 825 910 var settings, item, 826 911 matchedSection = /#(.*)$/.exec(clickedEl.href); … … 945 1030 var ins = $('#menu-instructions'); 946 1031 el.remove(); 947 1032 children.shiftDepthClass(-1).updateParentMenuItemDBId(); 948 if( ! ins.siblings().length ) 1033 if( 0 == $('#menu-to-edit li').length ) { 1034 $('.drag-instructions').hide(); 949 1035 ins.removeClass('menu-instructions-inactive'); 1036 } 950 1037 }); 951 1038 }, 952 1039 -
wp-admin/nav-menus.php
221 221 if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) 222 222 $messages[] = '<div id="message" class="updated"><p>' . __('The menu item has been successfully deleted.') . '</p></div>'; 223 223 break; 224 224 225 case 'delete': 225 226 check_admin_referer( 'delete-nav_menu-' . $nav_menu_selected_id ); 226 227 227 if ( is_nav_menu( $nav_menu_selected_id ) ) { 228 $deleted_nav_menu = wp_get_nav_menu_object( $nav_menu_selected_id ); 229 $delete_nav_menu = wp_delete_nav_menu( $nav_menu_selected_id ); 230 231 if ( is_wp_error($delete_nav_menu) ) { 232 $messages[] = '<div id="message" class="error"><p>' . $delete_nav_menu->get_error_message() . '</p></div>'; 233 } else { 234 // Remove this menu from any locations. 235 $locations = get_theme_mod( 'nav_menu_locations' ); 236 foreach ( (array) $locations as $location => $menu_id ) { 237 if ( $menu_id == $nav_menu_selected_id ) 238 $locations[ $location ] = 0; 239 } 240 set_theme_mod( 'nav_menu_locations', $locations ); 241 $messages[] = '<div id="message" class="updated"><p>' . __('The menu has been successfully deleted.') . '</p></div>'; 242 // Select the next available menu 243 $nav_menu_selected_id = 0; 244 $_nav_menus = wp_get_nav_menus( array('orderby' => 'name') ); 245 foreach( $_nav_menus as $index => $_nav_menu ) { 246 if ( strcmp( $_nav_menu->name, $deleted_nav_menu->name ) >= 0 247 || $index == count( $_nav_menus ) - 1 ) { 248 $nav_menu_selected_id = $_nav_menu->term_id; 249 break; 250 } 251 } 252 } 253 unset( $delete_nav_menu, $deleted_nav_menu, $_nav_menus ); 228 $deletion = _wp_delete_nav_menu( $nav_menu_selected_id ); 254 229 } else { 255 230 // Reset the selected menu 256 231 $nav_menu_selected_id = 0; 257 232 unset( $_REQUEST['menu'] ); 258 233 } 234 235 if ( ! isset( $deletion ) ) 236 break; 237 238 if ( is_wp_error( $deletion ) ) 239 $messages[] = '<div id="message" class="error"><p>' . $deletion->get_error_message() . '</p></div>'; 240 else 241 $messages[] = '<div id="message" class="updated"><p>' . __( 'The menu has been successfully deleted.' ) . '</p></div>'; 259 242 break; 260 243 244 case 'delete_menus': 245 check_admin_referer( 'nav_menus_bulk_actions' ); 246 foreach ( $_REQUEST['delete_menus'] as $menu_id_to_delete ) { 247 if ( ! is_nav_menu( $menu_id_to_delete ) ) 248 continue; 249 250 $deletion = _wp_delete_nav_menu( $menu_id_to_delete ); 251 if ( is_wp_error( $deletion ) ) { 252 $messages[] = '<div id="message" class="error"><p>' . $deletion->get_error_message() . '</p></div>'; 253 $deletion_error = true; 254 } 255 } 256 257 if ( empty( $deletion_error ) ) 258 $messages[] = '<div id="message" class="updated"><p>' . __( 'Selected menus have been successfully deleted.' ) . '</p></div>'; 259 break; 260 261 261 case 'update': 262 262 check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' ); 263 263 264 // Update menu theme locations265 if ( isset( $_POST['menu-locations'] ) )266 set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ));264 // get existing menu locations assignments 265 $locations = get_registered_nav_menus(); 266 $menu_locations = get_nav_menu_locations(); 267 267 268 // remove menu locations that have been unchecked 269 foreach ( $locations as $location => $description ) { 270 if ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) ) && isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id ) 271 unset( $menu_locations[ $location ] ); 272 } 273 274 // merge new and existing menu locations if any new ones are set 275 if ( isset( $_POST['menu-locations'] ) ) { 276 $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] ); 277 $menu_locations = array_merge( $menu_locations, $new_menu_locations ); 278 } 279 280 // set menu locations 281 set_theme_mod( 'nav_menu_locations', $menu_locations ); 282 268 283 // Add Menu 269 284 if ( 0 == $nav_menu_selected_id ) { 270 285 $new_menu_title = trim( esc_html( $_POST['menu-name'] ) ); … … 278 293 $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id ); 279 294 $nav_menu_selected_id = $_nav_menu_selected_id; 280 295 $nav_menu_selected_title = $_menu_object->name; 281 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __('The <strong>%s</strong> menu has been successfully created.'), $nav_menu_selected_title ) . '</p></div>'; 296 if ( isset( $_REQUEST['menu-item'] ) ) 297 wp_save_nav_menu_items( $nav_menu_selected_id, $_REQUEST['menu-item'] ); 298 if ( isset( $_REQUEST['zero-menu-state'] ) ) { 299 // If there are menu items, add them 300 wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ); 301 // Auto-save nav_menu_locations 302 $locations = get_theme_mod( 'nav_menu_locations' ); 303 foreach ( (array) $locations as $location => $menu_id ) { 304 $locations[ $location ] = $nav_menu_selected_id; 305 break; // There should only be 1 306 } 307 set_theme_mod( 'nav_menu_locations', $locations ); 308 } 309 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __('<strong>%s</strong> has been created.'), $nav_menu_selected_title ) . '</p></div>'; 282 310 } 283 311 } else { 284 312 $messages[] = '<div id="message" class="error"><p>' . __('Please enter a valid menu name.') . '</p></div>'; … … 309 337 // Update menu items 310 338 311 339 if ( ! is_wp_error( $_menu_object ) ) { 312 $unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID', 'post_status' => 'draft,publish') ); 313 $menu_items = array(); 314 // Index menu items by db ID 315 foreach( $unsorted_menu_items as $_item ) 316 $menu_items[$_item->db_id] = $_item; 317 318 $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' ); 319 wp_defer_term_counting(true); 320 // Loop through all the menu items' POST variables 321 if ( ! empty( $_POST['menu-item-db-id'] ) ) { 322 foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) { 323 324 // Menu item title can't be blank 325 if ( empty( $_POST['menu-item-title'][$_key] ) ) 326 continue; 327 328 $args = array(); 329 foreach ( $post_fields as $field ) 330 $args[$field] = isset( $_POST[$field][$_key] ) ? $_POST[$field][$_key] : ''; 331 332 $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args ); 333 334 if ( is_wp_error( $menu_item_db_id ) ) 335 $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>'; 336 elseif ( isset( $menu_items[$menu_item_db_id] ) ) 337 unset( $menu_items[$menu_item_db_id] ); 338 } 339 } 340 341 // Remove menu items from the menu that weren't in $_POST 342 if ( ! empty( $menu_items ) ) { 343 foreach ( array_keys( $menu_items ) as $menu_item_id ) { 344 if ( is_nav_menu_item( $menu_item_id ) ) { 345 wp_delete_post( $menu_item_id ); 346 } 347 } 348 } 349 350 // Store 'auto-add' pages. 351 $auto_add = ! empty( $_POST['auto-add-pages'] ); 352 $nav_menu_option = (array) get_option( 'nav_menu_options' ); 353 if ( ! isset( $nav_menu_option['auto_add'] ) ) 354 $nav_menu_option['auto_add'] = array(); 355 if ( $auto_add ) { 356 if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) 357 $nav_menu_option['auto_add'][] = $nav_menu_selected_id; 358 } else { 359 if ( false !== ( $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) ) 360 unset( $nav_menu_option['auto_add'][$key] ); 361 } 362 // Remove nonexistent/deleted menus 363 $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) ); 364 update_option( 'nav_menu_options', $nav_menu_option ); 365 366 wp_defer_term_counting(false); 367 368 do_action( 'wp_update_nav_menu', $nav_menu_selected_id ); 369 370 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __('The <strong>%s</strong> menu has been updated.'), $nav_menu_selected_title ) . '</p></div>'; 371 unset( $menu_items, $unsorted_menu_items ); 340 $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) ); 372 341 } 373 342 } 374 343 break; … … 376 345 377 346 // Get all nav menus 378 347 $nav_menus = wp_get_nav_menus( array('orderby' => 'name') ); 348 $menu_count = count( $nav_menus ); 379 349 350 // Are we on the add new screen? 351 $add_new_screen = ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] ) ? true : false; 352 353 // If we have one theme location, and zero menus, we take them right into editing their first menu 354 $one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty($nav_menus) && 0 < count(get_pages()) ) ? true : false; 355 356 // Redirect to add screen if there are no menus and this users has either zero, or more than 1 theme locations 357 if ( 0 == $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus ) 358 wp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) ); 359 380 360 // Get recently edited nav menu 381 361 $recently_edited = (int) get_user_option( 'nav_menu_recently_edited' ); 382 383 // If there was no recently edited menu, and $nav_menu_selected_id is a nav menu, update recently edited menu. 384 if ( !$recently_edited && is_nav_menu( $nav_menu_selected_id ) ) { 362 if ( !$recently_edited && is_nav_menu( $nav_menu_selected_id ) ) 385 363 $recently_edited = $nav_menu_selected_id; 386 364 387 // Else if $nav_menu_selected_id is not a menu and not requesting that we create a new menu, but $recently_edited is a menu, grab that one.388 } elseif ( 0 == $nav_menu_selected_id && ! isset( $_REQUEST['menu'] ) && is_nav_menu( $recently_edited ) ) { 365 // Use $recently_edited if none are selected 366 if ( 0 == $nav_menu_selected_id && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) ) 389 367 $nav_menu_selected_id = $recently_edited; 390 368 391 // Else try to grab the first menu from the menus list392 } elseif ( 0 == $nav_menu_selected_id && ! isset( $_REQUEST['menu'] ) && ! empty($nav_menus) ) { 369 // On deletion of menu, if another menu exists, show it 370 if ( ! $add_new_screen && 0 < $menu_count && isset( $_GET['action'] ) && 'delete' == $_GET['action'] ) 393 371 $nav_menu_selected_id = $nav_menus[0]->term_id; 394 } 372 373 if ( $one_theme_location_no_menus ) 374 $nav_menu_selected_id = 0; 395 375 396 376 // Update the user's setting 397 377 if ( $nav_menu_selected_id != $recently_edited && is_nav_menu( $nav_menu_selected_id ) ) … … 412 392 $nav_menus[$key]->truncated_name = $_nav_menu->truncated_name; 413 393 } 414 394 395 // Retrieve menu locations 396 if ( current_theme_supports( 'menus' ) ) { 397 $locations = get_registered_nav_menus(); 398 $menu_locations = get_nav_menu_locations(); 399 } 400 415 401 // Ensure the user will be able to scroll horizontally 416 402 // by adding a class for the max menu depth. 417 403 global $_wp_nav_menu_max_depth; 418 404 $_wp_nav_menu_max_depth = 0; 419 405 420 406 // Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth 421 if ( is_nav_menu( $nav_menu_selected_id ) ) 407 if ( is_nav_menu( $nav_menu_selected_id ) ) { 408 $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('post_status' => 'any') ); 422 409 $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); 410 } 423 411 424 412 function wp_nav_menu_max_depth($classes) { 425 413 global $_wp_nav_menu_max_depth; … … 460 448 ?> 461 449 <div class="wrap"> 462 450 <?php screen_icon(); ?> 463 <h2> <?php esc_html_e('Menus'); ?></h2>451 <h2>Menus <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0, ), admin_url( 'nav-menus.php' ) ) ); ?>" class="add-new-h2">Add New</a></h2> 464 452 <?php 465 453 foreach( $messages as $message ) : 466 454 echo $message . "\n"; 467 455 endforeach; 468 456 ?> 457 <?php if ( ! empty ( $menu_count ) ) : ?> 458 <div class="manage-menus"> 459 <span><?php _e('Selected menu'); ?></span> 460 <select> 461 <?php foreach( (array) $nav_menus as $_nav_menu ) : ?> 462 <option value="<?php echo esc_url(add_query_arg( array( 'action' => 'edit', 'menu' => $_nav_menu->term_id, ), admin_url( 'nav-menus.php' ) )); ?>" <?php if ( $nav_menu_selected_id == $_nav_menu->term_id ) echo 'selected="selected"'; ?>> 463 <?php 464 echo esc_html( $_nav_menu->truncated_name ) ; 465 if ( ! empty( $menu_locations ) && in_array( $_nav_menu->term_id, $menu_locations ) ) { 466 $locations_assigned_to_this_menu = array(); 467 foreach ( array_keys( $menu_locations, $_nav_menu->term_id ) as $menu_location_key ) { 468 $locations_assigned_to_this_menu[] = $locations[ $menu_location_key ]; 469 } 470 printf( ' (%s)', implode( ', ', $locations_assigned_to_this_menu ) ); 471 } 472 ?> 473 </option> 474 <?php endforeach; ?> 475 </select> 476 <span class="spinner"></span> 477 </div> 478 <?php endif; ?> 469 479 <div id="nav-menus-frame"> 470 <div id="menu-settings-column" class="metabox-holder<?php if ( !$nav_menu_selected_id) { echo ' metabox-holder-disabled'; } ?>">480 <div id="menu-settings-column" class="metabox-holder<?php if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) { echo ' metabox-holder-disabled'; } ?>"> 471 481 482 <div class="clear"></div> 483 472 484 <form id="nav-menu-meta" action="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-menu-meta" method="post" enctype="multipart/form-data"> 473 485 <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" /> 474 486 <input type="hidden" name="action" value="add-menu-item" /> … … 479 491 </div><!-- /#menu-settings-column --> 480 492 <div id="menu-management-liquid"> 481 493 <div id="menu-management"> 482 <div id="select-nav-menu-container" class="hide-if-js"> 483 <form id="select-nav-menu" action=""> 484 <strong><label for="select-nav-menu"><?php esc_html_e( 'Select Menu:' ); ?></label></strong> 485 <select class="select-nav-menu" name="menu"> 486 <?php foreach( (array) $nav_menus as $_nav_menu ) : ?> 487 <option value="<?php echo esc_attr($_nav_menu->term_id) ?>" <?php selected($nav_menu_selected_id, $_nav_menu->term_id); ?>> 488 <?php echo esc_html( $_nav_menu->truncated_name ); ?> 489 </option> 490 <?php endforeach; ?> 491 <option value="0"><?php esc_html_e('Add New Menu'); ?></option> 492 </select> 493 <input type="hidden" name="action" value="edit" /> 494 <?php submit_button( __( 'Select' ), 'secondary', 'select_menu', false ); ?> 495 </form> 496 </div> 497 <div class="nav-tabs-wrapper"> 498 <div class="nav-tabs"> 499 <?php 500 foreach( (array) $nav_menus as $_nav_menu ) : 501 if ( $nav_menu_selected_id == $_nav_menu->term_id ) : ?><span class="nav-tab nav-tab-active"> 502 <?php echo esc_html( $_nav_menu->truncated_name ); ?> 503 </span><?php else : ?><a href="<?php 504 echo esc_url(add_query_arg( 505 array( 506 'action' => 'edit', 507 'menu' => $_nav_menu->term_id, 508 ), 509 admin_url( 'nav-menus.php' ) 510 )); 511 ?>" class="nav-tab hide-if-no-js"> 512 <?php echo esc_html( $_nav_menu->truncated_name ); ?> 513 </a><?php endif; 514 endforeach; 515 if ( 0 == $nav_menu_selected_id ) : ?><span class="nav-tab menu-add-new nav-tab-active"> 516 <?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?> 517 </span><?php else : ?><a href="<?php 518 echo esc_url(add_query_arg( 519 array( 520 'action' => 'edit', 521 'menu' => 0, 522 ), 523 admin_url( 'nav-menus.php' ) 524 )); 525 ?>" class="nav-tab menu-add-new"> 526 <?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?> 527 </a><?php endif; ?> 528 </div> 529 </div> 530 <div class="menu-edit"> 531 <form id="update-nav-menu" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data"> 494 <form id="update-nav-menu" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data"> 495 <div class="menu-edit <?php if ( $add_new_screen ) echo 'blank-slate'; ?>"> 496 <?php 497 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); 498 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); 499 wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' ); 500 ?> 501 <?php if ( $one_theme_location_no_menus ) { ?> 502 <input type="hidden" name="zero-menu-state" value="true" /> 503 <?php } ?> 504 <input type="hidden" name="action" value="update" /> 505 <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" /> 532 506 <div id="nav-menu-header"> 533 <div id="submitpost" class="submitbox"> 534 <div class="major-publishing-actions"> 535 <label class="menu-name-label howto open-label" for="menu-name"> 536 <span><?php _e('Menu Name'); ?></span> 537 <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Enter menu name here'); ?>" value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" /> 538 </label> 539 <?php if ( !empty( $nav_menu_selected_id ) ) : 540 if ( ! isset( $auto_add ) ) { 541 $auto_add = get_option( 'nav_menu_options' ); 542 if ( ! isset( $auto_add['auto_add'] ) ) 543 $auto_add = false; 544 elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'] ) ) 545 $auto_add = true; 546 else 547 $auto_add = false; 548 } 549 ?> 550 <div class="auto-add-pages"> 551 <label class="howto"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" value="1" /> <?php printf( __('Automatically add new top-level pages' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label> 552 </div> 553 <?php endif; ?> 554 <br class="clear" /> 555 <div class="publishing-action"> 556 <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?> 557 </div><!-- END .publishing-action --> 558 559 <?php if ( ! empty( $nav_menu_selected_id ) ) : ?> 560 <div class="delete-action"> 561 <a class="submitdelete deletion menu-delete" href="<?php echo esc_url( wp_nonce_url( admin_url('nav-menus.php?action=delete&menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ) ); ?>"><?php _e('Delete Menu'); ?></a> 562 </div><!-- END .delete-action --> 563 <?php endif; ?> 564 </div><!-- END .major-publishing-actions --> 565 </div><!-- END #submitpost .submitbox --> 566 <?php 567 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); 568 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); 569 wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' ); 570 ?> 571 <input type="hidden" name="action" value="update" /> 572 <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" /> 573 </div><!-- END #nav-menu-header --> 507 <div class="major-publishing-actions"> 508 <label class="menu-name-label howto open-label" for="menu-name"> 509 <span><?php _e('Menu Name'); ?></span> 510 <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Enter menu name here'); ?>" value="<?php if ( $one_theme_location_no_menus ) { _e('Menu 1'); } else { echo esc_attr( $nav_menu_selected_title ); } ?>" /> 511 </label> 512 <div class="publishing-action"> 513 <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?> 514 </div><!-- END .publishing-action --> 515 </div><!-- END .major-publishing-actions --> 516 </div><!-- END .nav-menu-header --> 574 517 <div id="post-body"> 575 518 <div id="post-body-content"> 519 <?php if ( ! $add_new_screen ) : ?> 520 <?php $starter_copy = ( $one_theme_location_no_menus ) ? __("Edit your default menu by adding or removing items. Drag each item into the order you prefer. Click Create Menu to save your changes.") : __('Drag each item into the order you prefer. Click an item to reveal additional configuration options.') ; ?> 521 <div class="drag-instructions post-body-plain" <?php if ( isset( $menu_items ) && 0 == count( $menu_items ) ) { ?>style="display: none;"<?php } ?>> 522 <p><?php echo $starter_copy; ?></p> 523 </div> 576 524 <?php 577 if ( isset( $edit_markup ) ) { 578 if ( ! is_wp_error( $edit_markup ) ) 579 echo $edit_markup; 580 } else if ( empty( $nav_menu_selected_id ) ) { 581 echo '<div class="post-body-plain">'; 582 echo '<p>' . __('To create a custom menu, give it a name above and click Create Menu. Then choose items like pages, categories or custom links from the left column to add to this menu.') . '</p>'; 583 echo '<p>' . __('After you have added your items, drag and drop to put them in the order you want. You can also click each item to reveal additional configuration options.') . '</p>'; 584 echo '<p>' . __('When you have finished building your custom menu, make sure you click the Save Menu button.') . '</p>'; 585 echo '</div>'; 586 } 525 if ( isset( $edit_markup ) && ! is_wp_error( $edit_markup ) ) { 526 echo $edit_markup; 527 } else { 587 528 ?> 529 <ul class="menu" id="menu-to-edit"></ul> 530 <?php } ?> 531 <?php endif; ?> 532 <div class="menu-settings" <?php if ( $one_theme_location_no_menus ) { ?>style="display: none;"<?php } ?>> 533 <?php if ( $add_new_screen ) : ?> 534 <p class="post-body-plain"><?php _e('Give your menu a name above, then click Create Menu.'); ?></p> 535 <?php endif; ?> 536 <?php 537 if ( ! isset( $auto_add ) ) { 538 $auto_add = get_option( 'nav_menu_options' ); 539 if ( ! isset( $auto_add['auto_add'] ) ) 540 $auto_add = false; 541 elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'] ) ) 542 $auto_add = true; 543 else 544 $auto_add = false; 545 } ?> 546 547 <dl class="auto-add-pages"> 548 <dt class="howto"><?php _e('Auto add pages'); ?></dt> 549 <dd class="checkbox-input"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" id="auto-add-pages" value="1" /> <label for="auto-add-pages"><?php printf( __('Automatically add new top-level pages to this menu' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label></dd> 550 </dl> 551 552 <?php if ( current_theme_supports( 'menus' ) ) : ?> 553 554 <dl class="menu-theme-locations"> 555 <dt class="howto"><?php _e( 'Theme locations' ); ?></dt> 556 <?php foreach ( $locations as $location => $description ) : ?> 557 <dd class="checkbox-input"> 558 <input type="checkbox"<?php checked( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id ); ?> name="menu-locations[<?php echo esc_attr( $location ); ?>]" id="locations-<?php echo esc_attr( $location ); ?>" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" /> <label for="locations-<?php echo esc_attr( $location ); ?>"><?php echo $description; ?></label> 559 <?php if ( ! empty( $menu_locations[ $location ] ) && $menu_locations[ $location ] != $nav_menu_selected_id ) : ?> 560 <span class="theme-location-set"> <?php printf( __( "(Currently set to: %s)" ), wp_get_nav_menu_object( $menu_locations[ $location ] )->name ); ?> </span> 561 <?php endif; ?> 562 </dd> 563 <?php endforeach; ?> 564 </dl> 565 566 <?php endif; ?> 567 568 </div> 588 569 </div><!-- /#post-body-content --> 589 570 </div><!-- /#post-body --> 590 571 <div id="nav-menu-footer"> 591 572 <div class="major-publishing-actions"> 592 <div class="publishing-action"> 593 <?php 594 if ( ! empty( $nav_menu_selected_id ) ) 595 submit_button( __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_footer' ) ); 596 ?> 597 </div> 598 </div> 573 <?php if ( 0 != $menu_count && ! $add_new_screen ) : ?> 574 <span class="delete-action"> 575 <a class="submitdelete deletion menu-delete" href="<?php echo esc_url( wp_nonce_url( admin_url('nav-menus.php?action=delete&menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ) ); ?>"><?php _e('Delete Menu'); ?></a> 576 </span><!-- END .delete-action --> 577 <?php endif; ?> 578 <div class="publishing-action"> 579 <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?> 580 </div><!-- END .publishing-action --> 581 </div><!-- END .major-publishing-actions --> 599 582 </div><!-- /#nav-menu-footer --> 600 </ form><!-- /#update-nav-menu-->601 </ div><!-- /.menu-edit-->583 </div><!-- /.menu-edit --> 584 </form><!-- /#update-nav-menu --> 602 585 </div><!-- /#menu-management --> 603 586 </div><!-- /#menu-management-liquid --> 604 587 </div><!-- /#nav-menus-frame --> 605 588 </div><!-- /.wrap--> 606 607 <?php include( './admin-footer.php' ); ?> 589 <script type="text/javascript">var oneThemeLocationNoMenus = <?php if ( $one_theme_location_no_menus ) { echo 'true'; } else { echo 'false'; } ?>;</script> 590 <?php include( './admin-footer.php' ); ?> 591 No newline at end of file