Create a default menu containing the first 15 top-level pages. see #11817

git-svn-id: https://develop.svn.wordpress.org/trunk@13406 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-02-25 21:06:44 +00:00
parent 4d3733bef0
commit 60cb61e54f
2 changed files with 32 additions and 2 deletions
+6
View File
@@ -56,6 +56,12 @@ if ( isset( $_POST[ 'delete-menu' ] ) && $menu_selected_id > 0 ) {
// Default Menu to show
$custom_menus = wp_get_nav_menus();
if ( empty($custom_menus) && empty($_POST) ) {
wp_create_default_nav_menu();
$custom_menus = wp_get_nav_menus();
}
if ( ! $menu_selected_id && ! empty( $custom_menus ) )
$menu_selected_id = $custom_menus[0]->term_id;