diff --git a/src/wp-admin/js/customize-nav-menus.js b/src/wp-admin/js/customize-nav-menus.js
index 6dcdadc3fc..6731c34b67 100644
--- a/src/wp-admin/js/customize-nav-menus.js
+++ b/src/wp-admin/js/customize-nav-menus.js
@@ -104,6 +104,23 @@
deferred.resolve( response );
api.Menus.insertedAutoDrafts.push( response.post_id );
api( 'nav_menus_created_posts' ).set( _.clone( api.Menus.insertedAutoDrafts ) );
+
+ if ( 'page' === params.post_type ) {
+
+ // Activate static front page controls as this could be the first page created.
+ if ( api.section.has( 'static_front_page' ) ) {
+ api.section( 'static_front_page' ).activate();
+ }
+
+ // Add new page to dropdown-pages controls.
+ api.control.each( function( control ) {
+ var select;
+ if ( 'dropdown-pages' === control.params.type ) {
+ select = control.container.find( 'select[name^="_customize-dropdown-pages-"]' );
+ select.append( new Option( params.post_title, response.post_id ) );
+ }
+ } );
+ }
}
} );
diff --git a/src/wp-includes/class-wp-customize-control.php b/src/wp-includes/class-wp-customize-control.php
index 3f4877fd41..e8482b2df0 100644
--- a/src/wp-includes/class-wp-customize-control.php
+++ b/src/wp-includes/class-wp-customize-control.php
@@ -533,15 +533,24 @@ class WP_Customize_Control {
description; ?>
- id;
+ $show_option_none = __( '— Select —' );
+ $option_none_value = '0';
+ $dropdown = wp_dropdown_pages(
array(
- 'name' => '_customize-dropdown-pages-' . $this->id,
+ 'name' => $dropdown_name,
'echo' => 0,
- 'show_option_none' => __( '— Select —' ),
- 'option_none_value' => '0',
+ 'show_option_none' => $show_option_none,
+ 'option_none_value' => $option_none_value,
'selected' => $this->value(),
)
);
+ if ( empty( $dropdown ) ) {
+ $dropdown = sprintf( '';
+ }
// Hackily add in the data link parameter.
$dropdown = str_replace( '