diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index f0cceaeb39..42efbe6ebf 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -216,7 +216,7 @@ function wp_nav_menu_sub_items($childof, $intCounter, $parentli, $type, $output_ return $counter; } - +/* function wp_nav_menu_setup($override = false) { // Custom Navigation Menu Setup @@ -232,5 +232,5 @@ function wp_nav_menu_setup($override = false) { wp_create_nav_menu( __('Main') ); } - +/**/ ?> \ No newline at end of file diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index b79f2feadc..f490a6df91 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -70,13 +70,6 @@ if ( $menu_selected_id > 0 ) { } } -if ( isset( $_POST['set_wp_menu'] ) ) { - // @todo validate set_wp_menu - update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] ); - $updated = true; - $messagesdiv = '

' . __('Menu has been updated!') . '

'; -} - if ( isset( $_POST['licount'] ) ) $postCounter = $_POST['licount']; else @@ -84,6 +77,7 @@ else // Create a new menu. Menus are stored as terms in the 'menu' taxonomy. if ( isset( $_POST['add_menu'] ) && ! $updated ) { + update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] ); // Do we need this? $insert_menu_name = $_POST['add_menu_name']; if ( $insert_menu_name != '' ) { @@ -94,6 +88,7 @@ if ( isset( $_POST['add_menu'] ) && ! $updated ) { $custom_menus[$menu->term_id] = $menu; $menu_selected_id = $menu->term_id; $menu_id_in_edit = $menu_selected_id; + $menu_title = $menu->name; $messagesdiv = '

' . esc_html( sprintf( __('"%s" menu has been created!'), $menu->name ) ) . '

'; $postCounter = 0; } @@ -103,19 +98,7 @@ if ( isset( $_POST['add_menu'] ) && ! $updated ) { $updated = true; } -if ( isset($_POST['reset_wp_menu']) && ! $updated ) { - $success = wp_reset_nav_menu(); - if ( $success ) { - // DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly - $messagesdiv = '

' . __('The menu has been reset.') . '

'; - // GET reset menu id - $custom_menus = array(); - $menu_selected_id = 0; - } else { - // DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly - $messagesdiv = '

' . __('The menu could not be reset. Please try again.') . '

'; - } -} elseif ( $postCounter > 0 && $menu_selected_id > 0 && ! $updated ) { +if ( $postCounter > 0 && $menu_selected_id > 0 && ! $updated ) { $menu_items = wp_get_nav_menu_items( $menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') ); $parent_menu_ids = array(); @@ -174,8 +157,9 @@ if ( isset($_POST['reset_wp_menu']) && ! $updated ) {

+ 1 ) { ?>
-
-

' . __('Menu editing has not been Enabled yet. Please enable it in order to use it -------->') . '

'; - ?> - +
+
+ +
@@ -244,34 +224,17 @@ if ( isset($_POST['reset_wp_menu']) && ! $updated ) {
- - - - /> - /> - - -
- - - - - -

+ - +