]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-customize-control.php
WordPress 4.1.4-scripts
[autoinstalls/wordpress.git] / wp-includes / class-wp-customize-control.php
index 216ceafbf6290e43fe8ce993e2cf979bbfbbb544..950b0d5a344fffdb65fbd477d74c4b47519f203c 100644 (file)
@@ -7,6 +7,27 @@
  * @since 3.4.0
  */
 class WP_Customize_Control {
+
+       /**
+        * Incremented with each new class instantiation, then stored in $instance_number.
+        *
+        * Used when sorting two instances whose priorities are equal.
+        *
+        * @since 4.1.0
+        * @access protected
+        * @var int
+        */
+       protected static $instance_count = 0;
+
+       /**
+        * Order in which this instance was created in relation to other instances.
+        *
+        * @since 4.1.0
+        * @access public
+        * @var int
+        */
+       public $instance_number;
+
        /**
         * @access public
         * @var WP_Customize_Manager
@@ -74,6 +95,7 @@ class WP_Customize_Control {
        public $input_attrs = array();
 
        /**
+        * @deprecated It is better to just call the json() method
         * @access public
         * @var array
         */
@@ -126,6 +148,8 @@ class WP_Customize_Control {
                if ( empty( $this->active_callback ) ) {
                        $this->active_callback = array( $this, 'active_callback' );
                }
+               self::$instance_count += 1;
+               $this->instance_number = self::$instance_count;
 
                // Process settings.
                if ( empty( $this->settings ) ) {
@@ -152,7 +176,7 @@ class WP_Customize_Control {
        public function enqueue() {}
 
        /**
-        * Check whether control is active to current customizer preview.
+        * Check whether control is active to current Customizer preview.
         *
         * @since 4.0.0
         * @access public
@@ -218,7 +242,25 @@ class WP_Customize_Control {
                }
 
                $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;
+       }
+
+       /**
+        * Get the data to export to the client via JSON.
+        *
+        * @since 4.1.0
+        *
+        * @return array Array of parameters passed to the JavaScript.
+        */
+       public function json() {
+               $this->to_json();
+               return $this->json;
        }
 
        /**
@@ -241,6 +283,21 @@ class WP_Customize_Control {
                return true;
        }
 
+       /**
+        * Get the control's content for insertion into the Customizer pane.
+        *
+        * @since 4.1.0
+        *
+        * @return string Contents of the control.
+        */
+       public final function get_content() {
+               ob_start();
+               $this->maybe_render();
+               $template = trim( ob_get_contents() );
+               ob_end_clean();
+               return $template;
+       }
+
        /**
         * Check capabilities and render the control.
         *
@@ -263,12 +320,12 @@ class WP_Customize_Control {
                /**
                 * Fires just before a specific Customizer control is rendered.
                 *
-                * The dynamic portion of the hook name, $this->id, refers to
+                * The dynamic portion of the hook name, `$this->id`, refers to
                 * the control ID.
                 *
                 * @since 3.4.0
                 *
-                * @param WP_Customize_Control $this WP_Customize_Control instance.
+                * @param WP_Customize_Control $this {@see WP_Customize_Control} instance.
                 */
                do_action( 'customize_render_control_' . $this->id, $this );
 
@@ -336,6 +393,8 @@ class WP_Customize_Control {
         * Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`.
         * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly.
         *
+        * Control content can alternately be rendered in JS. See {@see WP_Customize_Control::print_template()}.
+        *
         * @since 3.4.0
         */
        protected function render_content() {
@@ -443,6 +502,38 @@ class WP_Customize_Control {
                                break;
                }
        }
+
+       /**
+        * Render the control's JS template.
+        *
+        * This function is only run for control types that have been registered with
+        * {@see WP_Customize_Manager::register_control_type()}.
+        *
+        * In the future, this will also print the template for the control's container
+        * element and be override-able.
+        *
+        * @since 4.1.0
+        */
+       final public function print_template() {
+               ?>
+               <script type="text/html" id="tmpl-customize-control-<?php echo $this->type; ?>-content">
+                       <?php $this->content_template(); ?>
+               </script>
+               <?php
+       }
+
+       /**
+        * An Underscore (JS) template for this control's content (but not its container).
+        *
+        * Class variables for this control class are available in the `data` JS object;
+        * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+        *
+        * @see WP_Customize_Control::print_template()
+        *
+        * @since 4.1.0
+        */
+       protected function content_template() {}
+
 }
 
 /**
@@ -499,33 +590,41 @@ class WP_Customize_Color_Control extends WP_Customize_Control {
        public function to_json() {
                parent::to_json();
                $this->json['statuses'] = $this->statuses;
+               $this->json['defaultValue'] = $this->setting->default;
        }
 
        /**
-        * Render the control's content.
+        * Don't render the control content from PHP, as it's rendered via JS on load.
         *
         * @since 3.4.0
         */
-       public function render_content() {
-               $this_default = $this->setting->default;
-               $default_attr = '';
-               if ( $this_default ) {
-                       if ( false === strpos( $this_default, '#' ) )
-                               $this_default = '#' . $this_default;
-                       $default_attr = ' data-default-color="' . esc_attr( $this_default ) . '"';
-               }
-               // The input's value gets set by JS. Don't fill it.
+       public function render_content() {}
+
+       /**
+        * Render a JS template for the content of the color picker control.
+        *
+        * @since 4.1.0
+        */
+       public function content_template() {
                ?>
+               <# var defaultValue = '';
+               if ( data.defaultValue ) {
+                       if ( '#' !== data.defaultValue.substring( 0, 1 ) ) {
+                               defaultValue = '#' + data.defaultValue;
+                       } else {
+                               defaultValue = data.defaultValue;
+                       }
+                       defaultValue = ' data-default-color=' + defaultValue; // Quotes added automatically.
+               } #>
                <label>
-                       <?php if ( ! empty( $this->label ) ) : ?>
-                               <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
-                       <?php endif;
-                       if ( ! empty( $this->description ) ) : ?>
-                               <span class="description customize-control-description"><?php echo $this->description; ?></span>
-                       <?php endif; ?>
-
+                       <# if ( data.label ) { #>
+                               <span class="customize-control-title">{{{ data.label }}}</span>
+                       <# } #>
+                       <# if ( data.description ) { #>
+                               <span class="description customize-control-description">{{{ data.description }}}</span>
+                       <# } #>
                        <div class="customize-control-content">
-                               <input class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value' ); ?>"<?php echo $default_attr; ?> />
+                               <input class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value' ); ?>" {{ defaultValue }} />
                        </div>
                </label>
                <?php
@@ -540,10 +639,33 @@ class WP_Customize_Color_Control extends WP_Customize_Control {
  * @since 3.4.0
  */
 class WP_Customize_Upload_Control extends WP_Customize_Control {
-       public $type    = 'upload';
-       public $removed = '';
-       public $context;
-       public $extensions = array();
+       public $type          = 'upload';
+       public $mime_type     = '';
+       public $button_labels = array();
+       public $removed = ''; // unused
+       public $context; // unused
+       public $extensions = array(); // unused
+
+       /**
+        * Constructor.
+        *
+        * @since 4.1.0
+        *
+        * @param WP_Customize_Manager $manager {@see WP_Customize_Manager} instance.
+        */
+       public function __construct( $manager, $id, $args = array() ) {
+               parent::__construct( $manager, $id, $args );
+
+               $this->button_labels = array(
+                       'select'       => __( 'Select File' ),
+                       'change'       => __( 'Change File' ),
+                       'default'      => __( 'Default' ),
+                       'remove'       => __( 'Remove' ),
+                       'placeholder'  => __( 'No file selected' ),
+                       'frame_title'  => __( 'Select File' ),
+                       'frame_button' => __( 'Choose File' ),
+               );
+       }
 
        /**
         * Enqueue control related scripts/styles.
@@ -551,7 +673,7 @@ class WP_Customize_Upload_Control extends WP_Customize_Control {
         * @since 3.4.0
         */
        public function enqueue() {
-               wp_enqueue_script( 'wp-plupload' );
+               wp_enqueue_media();
        }
 
        /**
@@ -562,35 +684,120 @@ class WP_Customize_Upload_Control extends WP_Customize_Control {
         */
        public function to_json() {
                parent::to_json();
+               $this->json['mime_type'] = $this->mime_type;
+               $this->json['button_labels'] = $this->button_labels;
+
+               $value = $this->value();
+
+               if ( is_object( $this->setting ) ) {
+                       if ( $this->setting->default ) {
+                               // Fake an attachment model - needs all fields used by template.
+                               $type = in_array( substr( $this->setting->default, -3 ), array( 'jpg', 'png', 'gif', 'bmp' ) ) ? 'image' : 'document';
+                               $default_attachment = array(
+                                       'id' => 1,
+                                       'url' => $this->setting->default,
+                                       'type' => $type,
+                                       'icon' => wp_mime_type_icon( $type ),
+                                       'title' => basename( $this->setting->default ),
+                               );
 
-               $this->json['removed'] = $this->removed;
+                               if ( 'image' === $type ) {
+                                       $default_attachment['sizes'] = array(
+                                               'full' => array( 'url' => $this->setting->default ),
+                                       );
+                               }
 
-               if ( $this->context )
-                       $this->json['context'] = $this->context;
+                               $this->json['defaultAttachment'] = $default_attachment;
+                       }
 
-               if ( $this->extensions )
-                       $this->json['extensions'] = implode( ',', $this->extensions );
+                       if ( $value && $this->setting->default && $value === $this->setting->default ) {
+                               // Set the default as the attachment.
+                               $this->json['attachment'] = $this->json['defaultAttachment'];
+                       } elseif ( $value ) {
+                               // Get the attachment model for the existing file.
+                               $attachment_id = attachment_url_to_postid( $value );
+                               if ( $attachment_id ) {
+                                       $this->json['attachment'] = wp_prepare_attachment_for_js( $attachment_id );
+                               }
+                       }
+               }
        }
 
        /**
-        * Render the control's content.
+        * Don't render any content for this control from PHP.
         *
+        * @see WP_Customize_Upload_Control::content_template()
         * @since 3.4.0
         */
-       public function render_content() {
+       public function render_content() {}
+
+       /**
+        * Render a JS template for the content of the upload control.
+        *
+        * @since 4.1.0
+        */
+       public function content_template() {
                ?>
-               <label>
-                       <?php if ( ! empty( $this->label ) ) : ?>
-                               <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
-                       <?php endif;
-                       if ( ! empty( $this->description ) ) : ?>
-                               <span class="description customize-control-description"><?php echo $this->description; ?></span>
-                       <?php endif; ?>
-                       <div>
-                               <a href="#" class="button-secondary upload"><?php _e( 'Upload' ); ?></a>
-                               <a href="#" class="remove"><?php _e( 'Remove' ); ?></a>
-                       </div>
+               <label for="{{ data.settings['default'] }}-button">
+                       <# if ( data.label ) { #>
+                               <span class="customize-control-title">{{ data.label }}</span>
+                       <# } #>
+                       <# if ( data.description ) { #>
+                               <span class="description customize-control-description">{{{ data.description }}}</span>
+                       <# } #>
                </label>
+
+               <# if ( data.attachment && data.attachment.id ) { #>
+                       <div class="current">
+                               <div class="container">
+                                       <div class="attachment-media-view attachment-media-view-{{ data.attachment.type }} {{ data.attachment.orientation }}">
+                                               <div class="thumbnail thumbnail-{{ data.attachment.type }}">
+                                                       <# if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.medium ) { #>
+                                                               <img class="attachment-thumb" src="{{ data.attachment.sizes.medium.url }}" draggable="false" />
+                                                       <# } else if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.full ) { #>
+                                                               <img class="attachment-thumb" src="{{ data.attachment.sizes.full.url }}" draggable="false" />
+                                                       <# } else if ( 'audio' === data.attachment.type ) { #>
+                                                               <img class="attachment-thumb type-icon" src="{{ data.attachment.icon }}" class="icon" draggable="false" />
+                                                               <p class="attachment-meta attachment-meta-title">&#8220;{{ data.attachment.title }}&#8221;</p>
+                                                               <# if ( data.attachment.album || data.attachment.meta.album ) { #>
+                                                               <p class="attachment-meta"><em>{{ data.attachment.album || data.attachment.meta.album }}</em></p>
+                                                               <# } #>
+                                                               <# if ( data.attachment.artist || data.attachment.meta.artist ) { #>
+                                                               <p class="attachment-meta">{{ data.attachment.artist || data.attachment.meta.artist }}</p>
+                                                               <# } #>
+                                                       <# } else { #>
+                                                               <img class="attachment-thumb type-icon" src="{{ data.attachment.icon }}" class="icon" draggable="false" />
+                                                               <p class="attachment-title">{{ data.attachment.title }}</p>
+                                                       <# } #>
+                                               </div>
+                                       </div>
+                               </div>
+                       </div>
+                       <div class="actions">
+                               <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
+                               <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['change']; ?></button>
+                               <div style="clear:both"></div>
+                       </div>
+               <# } else { #>
+                       <div class="current">
+                               <div class="container">
+                                       <div class="placeholder">
+                                               <div class="inner">
+                                                       <span>
+                                                               <?php echo $this->button_labels['placeholder']; ?>
+                                                       </span>
+                                               </div>
+                                       </div>
+                               </div>
+                       </div>
+                       <div class="actions">
+                               <# if ( data.defaultAttachment ) { #>
+                                       <button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button>
+                               <# } #>
+                               <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button>
+                               <div style="clear:both"></div>
+                       </div>
+               <# } #>
                <?php
        }
 }
@@ -604,11 +811,7 @@ class WP_Customize_Upload_Control extends WP_Customize_Control {
  */
 class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
        public $type = 'image';
-       public $get_url;
-       public $statuses;
-       public $extensions = array( 'jpg', 'jpeg', 'gif', 'png' );
-
-       protected $tabs = array();
+       public $mime_type = 'image';
 
        /**
         * Constructor.
@@ -618,167 +821,54 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
         *
         * @param WP_Customize_Manager $manager
         * @param string $id
-        * @param array $args
+        * @param array  $args
         */
-       public function __construct( $manager, $id, $args ) {
-               $this->statuses = array( '' => __('No Image') );
-
+       public function __construct( $manager, $id, $args = array() ) {
                parent::__construct( $manager, $id, $args );
 
-               $this->add_tab( 'upload-new', __('Upload New'), array( $this, 'tab_upload_new' ) );
-               $this->add_tab( 'uploaded',   __('Uploaded'),   array( $this, 'tab_uploaded' ) );
-
-               // Early priority to occur before $this->manager->prepare_controls();
-               add_action( 'customize_controls_init', array( $this, 'prepare_control' ), 5 );
+               $this->button_labels = array(
+                       'select'       => __( 'Select Image' ),
+                       'change'       => __( 'Change Image' ),
+                       'remove'       => __( 'Remove' ),
+                       'default'      => __( 'Default' ),
+                       'placeholder'  => __( 'No image selected' ),
+                       'frame_title'  => __( 'Select Image' ),
+                       'frame_button' => __( 'Choose Image' ),
+               );
        }
 
        /**
-        * Prepares the control.
-        *
-        * If no tabs exist, removes the control from the manager.
-        *
         * @since 3.4.2
+        * @deprecated 4.1.0
         */
-       public function prepare_control() {
-               if ( ! $this->tabs )
-                       $this->manager->remove_control( $this->id );
-       }
-
-       /**
-        * Refresh the parameters passed to the JavaScript via JSON.
-        *
-        * @since 3.4.0
-        * @uses WP_Customize_Upload_Control::to_json()
-        */
-       public function to_json() {
-               parent::to_json();
-               $this->json['statuses'] = $this->statuses;
-       }
-
-       /**
-        * Render the control's content.
-        *
-        * @since 3.4.0
-        */
-       public function render_content() {
-               $src = $this->value();
-               if ( isset( $this->get_url ) )
-                       $src = call_user_func( $this->get_url, $src );
-
-               ?>
-               <div class="customize-image-picker">
-                       <?php if ( ! empty( $this->label ) ) : ?>
-                               <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
-                       <?php endif;
-                       if ( ! empty( $this->description ) ) : ?>
-                               <span class="description customize-control-description"><?php echo $this->description; ?></span>
-                       <?php endif; ?>
-
-                       <div class="customize-control-content">
-                               <div class="dropdown preview-thumbnail" tabindex="0">
-                                       <div class="dropdown-content">
-                                               <?php if ( empty( $src ) ): ?>
-                                                       <img style="display:none;" />
-                                               <?php else: ?>
-                                                       <img src="<?php echo esc_url( set_url_scheme( $src ) ); ?>" />
-                                               <?php endif; ?>
-                                               <div class="dropdown-status"></div>
-                                       </div>
-                                       <div class="dropdown-arrow"></div>
-                               </div>
-                       </div>
-
-                       <div class="library">
-                               <ul>
-                                       <?php foreach ( $this->tabs as $id => $tab ): ?>
-                                               <li data-customize-tab='<?php echo esc_attr( $id ); ?>' tabindex='0'>
-                                                       <?php echo esc_html( $tab['label'] ); ?>
-                                               </li>
-                                       <?php endforeach; ?>
-                               </ul>
-                               <?php foreach ( $this->tabs as $id => $tab ): ?>
-                                       <div class="library-content" data-customize-tab='<?php echo esc_attr( $id ); ?>'>
-                                               <?php call_user_func( $tab['callback'] ); ?>
-                                       </div>
-                               <?php endforeach; ?>
-                       </div>
-
-                       <div class="actions">
-                               <a href="#" class="remove"><?php _e( 'Remove Image' ); ?></a>
-                       </div>
-               </div>
-               <?php
-       }
+       public function prepare_control() {}
 
        /**
-        * Add a tab to the control.
-        *
         * @since 3.4.0
+        * @deprecated 4.1.0
         *
         * @param string $id
         * @param string $label
         * @param mixed $callback
         */
-       public function add_tab( $id, $label, $callback ) {
-               $this->tabs[ $id ] = array(
-                       'label'    => $label,
-                       'callback' => $callback,
-               );
-       }
+       public function add_tab( $id, $label, $callback ) {}
 
        /**
-        * Remove a tab from the control.
-        *
         * @since 3.4.0
+        * @deprecated 4.1.0
         *
         * @param string $id
         */
-       public function remove_tab( $id ) {
-               unset( $this->tabs[ $id ] );
-       }
-
-       /**
-        * @since 3.4.0
-        */
-       public function tab_upload_new() {
-               if ( ! _device_can_upload() ) {
-                       echo '<p>' . sprintf( __('The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.'), 'http://apps.wordpress.org/' ) . '</p>';
-               } else {
-                       ?>
-                       <div class="upload-dropzone">
-                               <?php _e('Drop a file here or <a href="#" class="upload">select a file</a>.'); ?>
-                       </div>
-                       <div class="upload-fallback">
-                               <span class="button-secondary"><?php _e('Select File'); ?></span>
-                       </div>
-                       <?php
-               }
-       }
-
-       /**
-        * @since 3.4.0
-        */
-       public function tab_uploaded() {
-               ?>
-               <div class="uploaded-target"></div>
-               <?php
-       }
+       public function remove_tab( $id ) {}
 
        /**
         * @since 3.4.0
+        * @deprecated 4.1.0
         *
         * @param string $url
         * @param string $thumbnail_url
         */
-       public function print_tab_image( $url, $thumbnail_url = null ) {
-               $url = set_url_scheme( $url );
-               $thumbnail_url = ( $thumbnail_url ) ? set_url_scheme( $thumbnail_url ) : $url;
-               ?>
-               <a href="#" class="thumbnail" data-customize-image-value="<?php echo esc_url( $url ); ?>">
-                       <img src="<?php echo esc_url( $thumbnail_url ); ?>" />
-               </a>
-               <?php
-       }
+       public function print_tab_image( $url, $thumbnail_url = null ) {}
 }
 
 /**
@@ -789,6 +879,7 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
  * @since 3.4.0
  */
 class WP_Customize_Background_Image_Control extends WP_Customize_Image_Control {
+       public $type = 'background';
 
        /**
         * Constructor.
@@ -802,47 +893,33 @@ class WP_Customize_Background_Image_Control extends WP_Customize_Image_Control {
                parent::__construct( $manager, 'background_image', array(
                        'label'    => __( 'Background Image' ),
                        'section'  => 'background_image',
-                       'context'  => 'custom-background',
-                       'get_url'  => 'get_background_image',
                ) );
-
-               if ( $this->setting->default )
-                       $this->add_tab( 'default',  __('Default'),  array( $this, 'tab_default_background' ) );
        }
 
        /**
-        * @since 3.4.0
+        * Enqueue control related scripts/styles.
+        *
+        * @since 4.1.0
         */
-       public function tab_uploaded() {
-               $backgrounds = get_posts( array(
-                       'post_type'  => 'attachment',
-                       'meta_key'   => '_wp_attachment_is_custom_background',
-                       'meta_value' => $this->manager->get_stylesheet(),
-                       'orderby'    => 'none',
-                       'nopaging'   => true,
-               ) );
-
-               ?><div class="uploaded-target"></div><?php
-
-               if ( empty( $backgrounds ) )
-                       return;
-
-               foreach ( (array) $backgrounds as $background )
-                       $this->print_tab_image( esc_url_raw( $background->guid ) );
-       }
+       public function enqueue() {
+               parent::enqueue();
 
-       /**
-        * @since 3.4.0
-        * @uses WP_Customize_Image_Control::print_tab_image()
-        */
-       public function tab_default_background() {
-               $this->print_tab_image( $this->setting->default );
+               wp_localize_script( 'customize-controls', '_wpCustomizeBackground', array(
+                       'nonces' => array(
+                               'add' => wp_create_nonce( 'background-add' ),
+                       ),
+               ) );
        }
 }
 
 class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
        public $type = 'header';
+       public $uploaded_headers;
+       public $default_headers;
 
+       /**
+        * @param WP_Customize_Manager $manager
+        */
        public function __construct( $manager ) {
                parent::__construct( $manager, 'header_image', array(
                        'label'    => __( 'Header Image' ),
@@ -851,7 +928,6 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
                                'data'    => 'header_image_data',
                        ),
                        'section'  => 'header_image',
-                       'context'  => 'custom-header',
                        'removed'  => 'remove-header',
                        'get_url'  => 'get_header_image',
                ) );
@@ -1031,6 +1107,7 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
 /**
  * Widget Area Customize Control Class
  *
+ * @since 3.9.0
  */
 class WP_Widget_Area_Customize_Control extends WP_Customize_Control {
        public $type = 'sidebar_widgets';
@@ -1057,21 +1134,12 @@ class WP_Widget_Area_Customize_Control extends WP_Customize_Control {
                <?php
        }
 
-       /**
-        * Whether the current sidebar is rendered on the page.
-        *
-        * @since 4.0.0
-        * @access public
-        *
-        * @return bool Whether sidebar is rendered.
-        */
-       public function active_callback() {
-               return $this->manager->widgets->is_sidebar_rendered( $this->sidebar_id );
-       }
 }
 
 /**
  * Widget Form Customize Control Class
+ *
+ * @since 3.9.0
  */
 class WP_Widget_Form_Customize_Control extends WP_Customize_Control {
        public $type = 'widget_form';