Customizer: Register controls and settings for `nav_menu_locations` even when there are no menus yet.

This change ensures that the first menu created can be assigned to a location without first saving and reloading the Customizer.

Props markoheijnen.
Fixes #32858.

Built from https://develop.svn.wordpress.org/trunk@33094


git-svn-id: http://core.svn.wordpress.org/trunk@33065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2015-07-06 19:13:25 +00:00
parent 7b7fe01f76
commit a62cc940ea
4 changed files with 29 additions and 31 deletions

View File

@ -2545,6 +2545,7 @@
* @returns {string}
*/
function displayNavMenuName( name ) {
name = name || '';
name = $( '<div>' ).text( name ).html(); // Emulate esc_html() which is used in wp-admin/nav-menus.php.
name = $.trim( name );
return name || api.Menus.data.l10n.unnamed;

File diff suppressed because one or more lines are too long

View File

@ -433,8 +433,6 @@ final class WP_Customize_Nav_Menus {
'description' => $description,
) );
// @todo if ( ! $menus ) : make a "default" menu
if ( $menus ) {
$choices = array( '0' => __( '&mdash; Select &mdash;' ) );
foreach ( $menus as $menu ) {
$choices[ $menu->term_id ] = wp_html_excerpt( $menu->name, 40, '&hellip;' );
@ -464,7 +462,6 @@ final class WP_Customize_Nav_Menus {
'choices' => $choices,
) ) );
}
}
// Register each menu as a Customizer section, and add each menu item to each menu.
foreach ( $menus as $menu ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-beta1-33093';
$wp_version = '4.3-beta1-33094';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.