diff -r c7c34916027a -r 177826044cd9 wp/wp-includes/class-wp-customize-control.php --- a/wp/wp-includes/class-wp-customize-control.php Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-includes/class-wp-customize-control.php Mon Oct 14 18:28:13 2019 +0200 @@ -20,8 +20,6 @@ * Used when sorting two instances whose priorities are equal. * * @since 4.1.0 - * - * @static * @var int */ protected static $instance_count = 0; @@ -213,7 +211,7 @@ } $this->manager = $manager; - $this->id = $id; + $this->id = $id; if ( empty( $this->active_callback ) ) { $this->active_callback = array( $this, 'active_callback' ); } @@ -230,8 +228,8 @@ foreach ( $this->settings as $key => $setting ) { $settings[ $key ] = $this->manager->get_setting( $setting ); } - } else if ( is_string( $this->settings ) ) { - $this->setting = $this->manager->get_setting( $this->settings ); + } elseif ( is_string( $this->settings ) ) { + $this->setting = $this->manager->get_setting( $this->settings ); $settings['default'] = $this->setting; } $this->settings = $settings; @@ -253,7 +251,7 @@ */ final public function active() { $control = $this; - $active = call_user_func( $this->active_callback, $this ); + $active = call_user_func( $this->active_callback, $this ); /** * Filters response of WP_Customize_Control::active(). @@ -308,13 +306,13 @@ $this->json['settings'][ $key ] = $setting->id; } - $this->json['type'] = $this->type; - $this->json['priority'] = $this->priority; - $this->json['active'] = $this->active(); - $this->json['section'] = $this->section; - $this->json['content'] = $this->get_content(); - $this->json['label'] = $this->label; - $this->json['description'] = $this->description; + $this->json['type'] = $this->type; + $this->json['priority'] = $this->priority; + $this->json['active'] = $this->active(); + $this->json['section'] = $this->section; + $this->json['content'] = $this->get_content(); + $this->json['label'] = $this->label; + $this->json['description'] = $this->description; $this->json['instanceNumber'] = $this->instance_number; if ( 'dropdown-pages' === $this->type ) { @@ -385,8 +383,9 @@ * @uses WP_Customize_Control::render() */ final public function maybe_render() { - if ( ! $this->check_capabilities() ) + if ( ! $this->check_capabilities() ) { return; + } /** * Fires just before the current Customizer control is rendered. @@ -480,8 +479,8 @@ * @since 3.4.0 */ protected function render_content() { - $input_id = '_customize-input-' . $this->id; - $description_id = '_customize-description-' . $this->id; + $input_id = '_customize-input-' . $this->id; + $description_id = '_customize-description-' . $this->id; $describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : ''; switch ( $this->type ) { case 'checkbox': @@ -513,7 +512,7 @@ label ); ?> description ) ) : ?> - description ; ?> + description; ?> choices as $value => $label ) : ?> @@ -567,9 +566,8 @@ rows="5" input_attrs(); ?> - link(); ?>> - value() ); ?> - + link(); ?> + >value() ); ?> id; - $show_option_none = __( '— Select —' ); + $dropdown_name = '_customize-dropdown-pages-' . $this->id; + $show_option_none = __( '— Select —' ); $option_none_value = '0'; - $dropdown = wp_dropdown_pages( + $dropdown = wp_dropdown_pages( array( 'name' => $dropdown_name, 'echo' => 0, @@ -595,7 +593,7 @@ ) ); if ( empty( $dropdown ) ) { - $dropdown = sprintf( '', esc_attr( $dropdown_name ) ); $dropdown .= sprintf( '', esc_attr( $option_none_value ), esc_html( $show_option_none ) ); $dropdown .= ''; }