Changeset 20506 for trunk/wp-includes/class-wp-customize-control.php
- Timestamp:
- 04/18/2012 05:13:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-customize-control.php
r20504 r20506 23 23 public $json = array(); 24 24 25 public $visibility;26 27 25 public $type = 'text'; 28 26 … … 103 101 104 102 $this->json['type'] = $this->type; 105 106 if ( $this->visibility ) {107 if ( is_string( $this->visibility ) ) {108 $this->json['visibility'] = array(109 'id' => $this->visibility,110 'value' => true,111 );112 } else {113 $this->json['visibility'] = array(114 'id' => $this->visibility[0],115 'value' => $this->visibility[1],116 );117 }118 119 }120 103 } 121 104 … … 164 147 $class = 'customize-control customize-control-' . $this->type; 165 148 166 $style = ''; 167 if ( $this->visibility ) { 168 if ( is_string( $this->visibility ) ) { 169 $visibility_id = $this->visibility; 170 $visibility_value = true; 171 } else { 172 $visibility_id = $this->visibility[0]; 173 $visibility_value = $this->visibility[1]; 174 } 175 $visibility_setting = $this->manager->get_setting( $visibility_id ); 176 177 if ( $visibility_setting && $visibility_value != $visibility_setting->value() ) 178 $style = 'style="display:none;"'; 179 } 180 181 ?><li id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $class ); ?>" <?php echo $style; ?>> 149 ?><li id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $class ); ?>"> 182 150 <?php $this->render_content(); ?> 183 151 </li><?php
Note: See TracChangeset
for help on using the changeset viewer.