: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<?php checked( $this->value() ); ?>
<label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $this->label ); ?></label>
<?php if ( ! empty( $this->description ) ) : ?>
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
if ( empty( $this->choices ) ) {
$name = '_customize-radio-' . $this->id;
<?php if ( ! empty( $this->label ) ) : ?>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<?php if ( ! empty( $this->description ) ) : ?>
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
<?php foreach ( $this->choices as $value => $label ) : ?>
<span class="customize-inside-control-row">
id="<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>"
<?php echo $describedby_attr; ?>
value="<?php echo esc_attr( $value ); ?>"
name="<?php echo esc_attr( $name ); ?>"
<?php checked( $this->value(), $value ); ?>
<label for="<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>"><?php echo esc_html( $label ); ?></label>
if ( empty( $this->choices ) ) {
<?php if ( ! empty( $this->label ) ) : ?>
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
<?php if ( ! empty( $this->description ) ) : ?>
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
<select id="<?php echo esc_attr( $input_id ); ?>" <?php echo $describedby_attr; ?> <?php $this->link(); ?>>
foreach ( $this->choices as $value => $label ) {
echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . esc_html( $label ) . '</option>';
<?php if ( ! empty( $this->label ) ) : ?>
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
<?php if ( ! empty( $this->description ) ) : ?>
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
id="<?php echo esc_attr( $input_id ); ?>"
<?php echo $describedby_attr; ?>
<?php $this->input_attrs(); ?>
><?php echo esc_textarea( $this->value() ); ?></textarea>
<?php if ( ! empty( $this->label ) ) : ?>
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
<?php if ( ! empty( $this->description ) ) : ?>
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
$dropdown_name = '_customize-dropdown-pages-' . $this->id;
$show_option_none = __( '— Select —' );
$option_none_value = '0';
$dropdown = wp_dropdown_pages(
'name' => $dropdown_name,
'show_option_none' => $show_option_none,
'option_none_value' => $option_none_value,
'selected' => $this->value(),
if ( empty( $dropdown ) ) {
$dropdown = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) );
$dropdown .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $option_none_value ), esc_html( $show_option_none ) );
$dropdown .= '</select>';
// Hackily add in the data link parameter.
$dropdown = str_replace( '<select', '<select ' . $this->get_link() . ' id="' . esc_attr( $input_id ) . '" ' . $describedby_attr, $dropdown );
* Even more hacikly add auto-draft page stubs.
* @todo Eventually this should be removed in favor of the pages being injected into the underlying get_pages() call.
* See <https://github.com/xwp/wp-customize-posts/pull/250>.
$nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' );
if ( $nav_menus_created_posts_setting && current_user_can( 'publish_pages' ) ) {
$auto_draft_page_options = '';
foreach ( $nav_menus_created_posts_setting->value() as $auto_draft_page_id ) {
$post = get_post( $auto_draft_page_id );
if ( $post && 'page' === $post->post_type ) {
$auto_draft_page_options .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $post->ID ), esc_html( $post->post_title ) );
if ( $auto_draft_page_options ) {
$dropdown = str_replace( '</select>', $auto_draft_page_options . '</select>', $dropdown );
<?php if ( $this->allow_addition && current_user_can( 'publish_pages' ) && current_user_can( 'edit_theme_options' ) ) : // Currently tied to menus functionality. ?>
<button type="button" class="button-link add-new-toggle">
/* translators: %s: Add New Page label. */
printf( __( '+ %s' ), get_post_type_object( 'page' )->labels->add_new_item );
<div class="new-content-item-wrapper">
<label for="create-input-<?php echo esc_attr( $this->id ); ?>"><?php _e( 'New page title' ); ?></label>
<div class="new-content-item">
<input type="text" id="create-input-<?php echo esc_attr( $this->id ); ?>" class="create-item-input" >
<button type="button" class="button add-content"><?php _e( 'Add' ); ?></button>
<?php if ( ! empty( $this->label ) ) : ?>
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
<?php if ( ! empty( $this->description ) ) : ?>
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
id="<?php echo esc_attr( $input_id ); ?>"
type="<?php echo esc_attr( $this->type ); ?>"
<?php echo $describedby_attr; ?>
<?php $this->input_attrs(); ?>
<?php if ( ! isset( $this->input_attrs['value'] ) ) : ?>
value="<?php echo esc_attr( $this->value() ); ?>"
* Render the control's JS template.
* This function is only run for control types that have been registered with
* WP_Customize_Manager::register_control_type().
* In the future, this will also print the template for the control's container
* element and be override-able.
final public function print_template() {
<script type="text/html" id="tmpl-customize-control-<?php echo esc_attr( $this->type ); ?>-content">
<?php $this->content_template(); ?>
* An Underscore (JS) template for this control's content (but not its container).
* Class variables for this control class are available in the `data` JS object;
* export custom variables by overriding WP_Customize_Control::to_json().
* @see WP_Customize_Control::print_template()
protected function content_template() {}
* WP_Customize_Color_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php';
* WP_Customize_Media_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php';
* WP_Customize_Upload_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php';
* WP_Customize_Image_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php';
* WP_Customize_Background_Image_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php';
* WP_Customize_Background_Position_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php';
* WP_Customize_Cropped_Image_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php';
* WP_Customize_Site_Icon_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php';
* WP_Customize_Header_Image_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php';
* WP_Customize_Theme_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php';
* WP_Widget_Area_Customize_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php';
* WP_Widget_Form_Customize_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php';
* WP_Customize_Nav_Menu_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php';
* WP_Customize_Nav_Menu_Item_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php';
* WP_Customize_Nav_Menu_Location_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php';
* WP_Customize_Nav_Menu_Name_Control class.
* As this file is deprecated, it will trigger a deprecation notice if instantiated. In a subsequent
* release, the require_once here will be removed and _deprecated_file() will be called if file is
* @deprecated 4.9.0 This file is no longer used due to new menu creation UX.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php';
* WP_Customize_Nav_Menu_Locations_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php';
* WP_Customize_Nav_Menu_Auto_Add_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php';
* WP_Customize_Date_Time_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-customize-date-time-control.php';
* WP_Sidebar_Block_Editor_Control class.
require_once ABSPATH . WPINC . '/customize/class-wp-sidebar-block-editor-control.php';