X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/61343b82c4f0da4c68e4c6373daafff4a81efdd1..53a5df18dd17a11c18781e78349feb3e139096b4:/wp-admin/nav-menus.php diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index 549d03b5..7306778a 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -10,7 +10,7 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( './admin.php' ); +require_once( dirname( __FILE__ ) . '/admin.php' ); // Load all the nav menu interface functions require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' ); @@ -300,18 +300,19 @@ switch ( $action ) { // If there are menu items, add them wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ); // Auto-save nav_menu_locations - $locations = get_theme_mod( 'nav_menu_locations' ); - foreach ( (array) $locations as $location => $menu_id ) { + $locations = get_nav_menu_locations(); + foreach ( $locations as $location => $menu_id ) { $locations[ $location ] = $nav_menu_selected_id; break; // There should only be 1 } set_theme_mod( 'nav_menu_locations', $locations ); } if ( isset( $_REQUEST['use-location'] ) ) { - $locations = get_theme_mod( 'nav_menu_locations' ); - if ( isset( $locations[$_REQUEST['use-location']] ) ) - $locations[$_REQUEST['use-location']] = $nav_menu_selected_id; - set_theme_mod( 'nav_menu_locations', $locations ); + $locations = get_registered_nav_menus(); + $menu_locations = get_nav_menu_locations(); + if ( isset( $locations[ $_REQUEST['use-location'] ] ) ) + $menu_locations[ $_REQUEST['use-location'] ] = $nav_menu_selected_id; + set_theme_mod( 'nav_menu_locations', $menu_locations ); } // $messages[] = '

' . sprintf( __( '%s has been created.' ), $nav_menu_selected_title ) . '

'; wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) ); @@ -471,11 +472,11 @@ wp_nav_menu_setup(); wp_initial_nav_menu_meta_boxes(); if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) - $messages[] = '

' . sprintf( __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a “Custom Menus” widget on the Widgets screen.' ), admin_url( 'widgets.php' ) ) . '

'; + $messages[] = '

' . sprintf( __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a “Custom Menu” widget on the Widgets screen.' ), admin_url( 'widgets.php' ) ) . '

'; if ( ! $locations_screen ) : // Main tab $overview = '

' . __( 'This screen is used for managing your custom navigation menus.' ) . '

'; - $overview .= '

' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a “Custom Menus” widget on the Widgets screen. If your theme does not support the custom menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Thirteen', 'Twenty Twelve' ) . '

'; + $overview .= '

' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a “Custom Menu” widget on the Widgets screen. If your theme does not support the custom menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Thirteen', 'Twenty Twelve' ) . '

'; $overview .= '

' . __( 'From this screen you can:' ) . '

'; $overview .= ''; @@ -498,7 +499,7 @@ if ( ! $locations_screen ) : // Main tab ) ); $editing_menus = '

' . __( 'Each custom menu may contain a mix of links to pages, categories, custom URLs or other content types. Menu links are added by selecting items from the expanding boxes in the left-hand column below.' ) . '

'; - $editing_menus .= '

' . __( 'Clicking the title of any menu item in the editor will reveal a standard group of settings. Additional settings such as link target, CSS classes, link relationships, and link descriptions can be enabled and disabled via the Screen Options tab.' ) . '

'; + $editing_menus .= '

' . __( 'Clicking the arrow to the right of any menu item in the editor will reveal a standard group of settings. Additional settings such as link target, CSS classes, link relationships, and link descriptions can be enabled and disabled via the Screen Options tab.' ) . '

'; $editing_menus .= '