Make WordPress Core

Changeset 14623


Ignore:
Timestamp:
05/14/2010 06:44:54 AM (14 years ago)
Author:
nacin
Message:

If theme has registered menus, set the first menu created to the first registered location by default. see #13378.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/nav-menus.php

    r14622 r14623  
    270270                        $messages[] = '<div id="message" class="error"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
    271271                    } else {
     272                        if ( ( $_menu_locations = get_registered_nav_menus() ) && 1 == count( wp_get_nav_menus() ) )
     273                            set_theme_mod( 'nav_menu_locations', array( key( $_menu_locations ) => $_nav_menu_selected_id ) );
     274                        unset( $_menu_locations );
    272275                        $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
    273276                        $nav_menu_selected_id = $_nav_menu_selected_id;
Note: See TracChangeset for help on using the changeset viewer.