wp/wp-includes/class-wp-customize-control.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
--- 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 @@
 					<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
 				<?php endif; ?>
 				<?php if ( ! empty( $this->description ) ) : ?>
-					<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description ; ?></span>
+					<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
 				<?php endif; ?>
 
 				<?php foreach ( $this->choices as $value => $label ) : ?>
@@ -567,9 +566,8 @@
 					rows="5"
 					<?php echo $describedby_attr; ?>
 					<?php $this->input_attrs(); ?>
-					<?php $this->link(); ?>>
-					<?php echo esc_textarea( $this->value() ); ?>
-				</textarea>
+					<?php $this->link(); ?>
+				><?php echo esc_textarea( $this->value() ); ?></textarea>
 				<?php
 				break;
 			case 'dropdown-pages':
@@ -582,10 +580,10 @@
 				<?php endif; ?>
 
 				<?php
-				$dropdown_name = '_customize-dropdown-pages-' . $this->id;
-				$show_option_none = __( '&mdash; Select &mdash;' );
+				$dropdown_name     = '_customize-dropdown-pages-' . $this->id;
+				$show_option_none  = __( '&mdash; Select &mdash;' );
 				$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( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) );
+					$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>';
 				}