Changeset 42343 for trunk/src/wp-includes/class-wp-customize-control.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-control.php
r42034 r42343 214 214 215 215 $this->manager = $manager; 216 $this->id = $id;216 $this->id = $id; 217 217 if ( empty( $this->active_callback ) ) { 218 218 $this->active_callback = array( $this, 'active_callback' ); … … 231 231 $settings[ $key ] = $this->manager->get_setting( $setting ); 232 232 } 233 } else 234 $this->setting = $this->manager->get_setting( $this->settings );233 } elseif ( is_string( $this->settings ) ) { 234 $this->setting = $this->manager->get_setting( $this->settings ); 235 235 $settings['default'] = $this->setting; 236 236 } … … 254 254 final public function active() { 255 255 $control = $this; 256 $active = call_user_func( $this->active_callback, $this );256 $active = call_user_func( $this->active_callback, $this ); 257 257 258 258 /** … … 309 309 } 310 310 311 $this->json['type'] = $this->type;312 $this->json['priority'] = $this->priority;313 $this->json['active'] = $this->active();314 $this->json['section'] = $this->section;315 $this->json['content'] = $this->get_content();316 $this->json['label'] = $this->label;317 $this->json['description'] = $this->description;311 $this->json['type'] = $this->type; 312 $this->json['priority'] = $this->priority; 313 $this->json['active'] = $this->active(); 314 $this->json['section'] = $this->section; 315 $this->json['content'] = $this->get_content(); 316 $this->json['label'] = $this->label; 317 $this->json['description'] = $this->description; 318 318 $this->json['instanceNumber'] = $this->instance_number; 319 319 … … 386 386 */ 387 387 final public function maybe_render() { 388 if ( ! $this->check_capabilities() ) 388 if ( ! $this->check_capabilities() ) { 389 389 return; 390 } 390 391 391 392 /** … … 481 482 */ 482 483 protected function render_content() { 483 $input_id = '_customize-input-' . $this->id;484 $description_id = '_customize-description-' . $this->id;484 $input_id = '_customize-input-' . $this->id; 485 $description_id = '_customize-description-' . $this->id; 485 486 $describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : ''; 486 487 switch ( $this->type ) { … … 514 515 <?php endif; ?> 515 516 <?php if ( ! empty( $this->description ) ) : ?> 516 <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description 517 <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span> 517 518 <?php endif; ?> 518 519 … … 583 584 584 585 <?php 585 $dropdown_name = '_customize-dropdown-pages-' . $this->id;586 $show_option_none = __( '— Select —' );586 $dropdown_name = '_customize-dropdown-pages-' . $this->id; 587 $show_option_none = __( '— Select —' ); 587 588 $option_none_value = '0'; 588 $dropdown = wp_dropdown_pages(589 $dropdown = wp_dropdown_pages( 589 590 array( 590 591 'name' => $dropdown_name, … … 596 597 ); 597 598 if ( empty( $dropdown ) ) { 598 $dropdown = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) );599 $dropdown = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) ); 599 600 $dropdown .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $option_none_value ), esc_html( $show_option_none ) ); 600 601 $dropdown .= '</select>';
Note: See TracChangeset
for help on using the changeset viewer.