diff --git a/src/wp-includes/nav-menu.php b/src/wp-includes/nav-menu.php index 1fe2bc339a..91a102a880 100644 --- a/src/wp-includes/nav-menu.php +++ b/src/wp-includes/nav-menu.php @@ -277,15 +277,27 @@ function wp_update_nav_menu_object( $menu_id = 0, $menu_data = array() ) { ! is_wp_error( $_possible_existing ) && isset( $_possible_existing->term_id ) && $_possible_existing->term_id != $menu_id - ) - return new WP_Error( 'menu_exists', sprintf( __('The menu name %s conflicts with another menu name. Please try another.'), esc_html( $menu_data['menu-name'] ) ) ); + ) { + return new WP_Error( 'menu_exists', + /* translators: %s: menu name */ + sprintf( __( 'The menu name %s conflicts with another menu name. Please try another.' ), + '' . esc_html( $menu_data['menu-name'] ) . '' + ) + ); + } // menu doesn't already exist, so create a new menu if ( ! $_menu || is_wp_error( $_menu ) ) { $menu_exists = get_term_by( 'name', $menu_data['menu-name'], 'nav_menu' ); - if ( $menu_exists ) - return new WP_Error( 'menu_exists', sprintf( __('The menu name %s conflicts with another menu name. Please try another.'), esc_html( $menu_data['menu-name'] ) ) ); + if ( $menu_exists ) { + return new WP_Error( 'menu_exists', + /* translators: %s: menu name */ + sprintf( __( 'The menu name %s conflicts with another menu name. Please try another.' ), + '' . esc_html( $menu_data['menu-name'] ) . '' + ) + ); + } $_menu = wp_insert_term( $menu_data['menu-name'], 'nav_menu', $args );