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: http://svn.automattic.com/wordpress/trunk@14590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-05-12 21:23:29 +00:00
parent e15c230ffc
commit 7231cc8a56
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;