Don't pass a slug when creating anew menu. This prevents creating a menu whose slug matches a different term in another taxonomy. Props filosofo. fixes #13345

git-svn-id: https://develop.svn.wordpress.org/trunk@14590 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-05-12 21:23:29 +00:00
parent 7c0dcdca6b
commit 6648182c8c
1 changed files with 1 additions and 6 deletions

View File

@ -91,12 +91,7 @@ function wp_create_nav_menu( $menu_name, $args = array() ) {
if ( $menu_exists )
return new WP_Error( 'menu_exists', sprintf( __('The menu name <strong>%s</strong> conflicts with another menu name. Please try another.'), esc_html( $menu_name ) ) );
if ( isset($args['slug']) )
$slug = $args['slug'];
else
$slug = $menu_name;
$menu = wp_insert_term( $menu_name, 'nav_menu', array('slug' => $slug) );
$menu = wp_insert_term( $menu_name, 'nav_menu' );
if ( is_wp_error($menu) )
return $menu;