Make WordPress Core


Ignore:
Timestamp:
04/18/2012 05:13:31 PM (14 years ago)
Author:
koopersmith
Message:

Remove 'visibility' parameter from WP_Customize_Control. Handle control visibility in JS instead. see #19910.

  • Have the header text color picker display only when header_textcolor != 'blank'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-customize-control.php

    r20504 r20506  
    2323        public $json = array();
    2424
    25         public $visibility;
    26 
    2725        public $type = 'text';
    2826
    … …  
    103101
    104102                $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                 }
    120103        }
    121104
    … …  
    164147                $class = 'customize-control customize-control-' . $this->type;
    165148
    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 ); ?>">
    182150                        <?php $this->render_content(); ?>
    183151                </li><?php
Note: See TracChangeset for help on using the changeset viewer.