Changeset 20260
- Timestamp:
- 03/22/2012 07:17:26 AM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-customize-section.php
r20248 r20260 84 84 <h3 class="customize-section-title" title="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3> 85 85 <ul class="customize-section-content"> 86 <?php foreach ( $this->settings as $setting ) : ?> 87 <li id="customize-control-<?php echo esc_attr( $setting->id ); ?>" class="customize-control customize-control-<?php echo esc_attr( $setting->control ); ?>"> 88 <?php $setting->maybe_render(); ?> 89 </li> 90 <?php endforeach; ?> 86 <?php 87 foreach ( $this->settings as $setting ) 88 $setting->maybe_render(); 89 ?> 91 90 </ul> 92 91 </li> -
trunk/wp-includes/class-wp-customize-setting.php
r20254 r20260 21 21 public $default = ''; 22 22 public $sanitize_callback = ''; 23 public $visibility; 23 24 24 25 protected $id_data = array(); … … 297 298 298 299 /** 299 * Render the control. 300 * Render the control. Renders the control wrapper, then calls $this->render_content(). 300 301 * 301 302 * @since 3.4.0 302 303 */ 303 304 protected function render() { 305 306 $id = 'customize-control-' . $this->id; 307 $class = 'customize-control customize-control-' . $this->control; 308 309 $style = ''; 310 if ( $this->visibility ) { 311 $visibility_setting = $this->manager->get_setting( $this->visibility[0] ); 312 $visibility_value = isset( $this->visibility[1] ) ? $this->visibility[1] : true; 313 314 if ( $visibility_setting && $visibility_value != $visibility_setting->value() ) 315 $style = 'style="display:none;"'; 316 } 317 318 ?><li id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $class ); ?>" <?php echo $style; ?>> 319 <?php $this->render_content(); ?> 320 </li><?php 321 } 322 323 /** 324 * Render the control's content. 325 * 326 * Allows the content to be overriden without having to rewrite the wrapper. 327 * 328 * @since 3.4.0 329 */ 330 protected function render_content() { 304 331 switch( $this->control ) { 305 332 case 'text': -
trunk/wp-includes/class-wp-customize.php
r20254 r20260 619 619 'default' => get_option( 'show_on_front' ), 620 620 'type' => 'option', 621 'capability' => 'manage_options' 621 'capability' => 'manage_options', 622 622 ) ); 623 623 … … 628 628 'control' => 'dropdown-pages', 629 629 'type' => 'option', 630 'capability' => 'manage_options' 630 'capability' => 'manage_options', 631 'visibility' => array( 'show_on_front', 'page' ), 631 632 ) ); 632 633 … … 637 638 'control' => 'dropdown-pages', 638 639 'type' => 'option', 639 'capability' => 'manage_options' 640 'capability' => 'manage_options', 641 'visibility' => array( 'show_on_front', 'page' ), 640 642 ) ); 641 643 … … 651 653 'default' => get_option( 'blogname' ), 652 654 'type' => 'option', 653 'capability' => 'manage_options' 655 'capability' => 'manage_options', 654 656 ) ); 655 657 … … 659 661 'default' => get_option( 'blogdescription' ), 660 662 'type' => 'option', 661 'capability' => 'manage_options' 663 'capability' => 'manage_options', 662 664 ) ); 663 665 } -
trunk/wp-includes/customize-controls.php
r20248 r20260 105 105 'control' => $setting->control, 106 106 ); 107 108 if ( $setting->visibility ) { 109 $settings['controls'][ $id ]['visibility'] = array( 110 'id' => $setting->visibility[0], 111 'value' => isset( $setting->visibility[1] ) ? $setting->visibility[1] : true, 112 ); 113 } 107 114 } 108 115 -
trunk/wp-includes/js/customize-controls.dev.js
r20259 r20260 231 231 232 232 $.each( api.settings.controls, function( id, data ) { 233 var constructor = api.controls[ data.control ] || api.Control; 234 api.add( id, new constructor( id, data.value, { 233 var constructor = api.controls[ data.control ] || api.Control, 234 control; 235 236 control = api.add( id, new constructor( id, data.value, { 235 237 previewer: previewer 236 238 } ) ); 239 240 if ( data.visibility ) { 241 api( data.visibility.id, function( other ) { 242 other.bind( function( to ) { 243 control.container.toggle( to == data.visibility.value ); 244 }); 245 }); 246 } 237 247 }); 238 248
Note: See TracChangeset
for help on using the changeset viewer.