[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/ -> class-wp-customize-control.php (source)

   1  <?php
   2  /**
   3   * WordPress Customize Control classes
   4   *
   5   * @package WordPress
   6   * @subpackage Customize
   7   * @since 3.4.0
   8   */
   9  
  10  /**
  11   * Customize Control class.
  12   *
  13   * @since 3.4.0
  14   */
  15  class WP_Customize_Control {
  16  
  17      /**
  18       * Incremented with each new class instantiation, then stored in $instance_number.
  19       *
  20       * Used when sorting two instances whose priorities are equal.
  21       *
  22       * @since 4.1.0
  23       * @var int
  24       */
  25      protected static $instance_count = 0;
  26  
  27      /**
  28       * Order in which this instance was created in relation to other instances.
  29       *
  30       * @since 4.1.0
  31       * @var int
  32       */
  33      public $instance_number;
  34  
  35      /**
  36       * Customizer manager.
  37       *
  38       * @since 3.4.0
  39       * @var WP_Customize_Manager
  40       */
  41      public $manager;
  42  
  43      /**
  44       * Control ID.
  45       *
  46       * @since 3.4.0
  47       * @var string
  48       */
  49      public $id;
  50  
  51      /**
  52       * All settings tied to the control.
  53       *
  54       * @since 3.4.0
  55       * @var array
  56       */
  57      public $settings;
  58  
  59      /**
  60       * The primary setting for the control (if there is one).
  61       *
  62       * @since 3.4.0
  63       * @var string
  64       */
  65      public $setting = 'default';
  66  
  67      /**
  68       * Capability required to use this control.
  69       *
  70       * Normally this is empty and the capability is derived from the capabilities
  71       * of the associated `$settings`.
  72       *
  73       * @since 4.5.0
  74       * @var string
  75       */
  76      public $capability;
  77  
  78      /**
  79       * Order priority to load the control in Customizer.
  80       *
  81       * @since 3.4.0
  82       * @var int
  83       */
  84      public $priority = 10;
  85  
  86      /**
  87       * Section the control belongs to.
  88       *
  89       * @since 3.4.0
  90       * @var string
  91       */
  92      public $section = '';
  93  
  94      /**
  95       * Label for the control.
  96       *
  97       * @since 3.4.0
  98       * @var string
  99       */
 100      public $label = '';
 101  
 102      /**
 103       * Description for the control.
 104       *
 105       * @since 4.0.0
 106       * @var string
 107       */
 108      public $description = '';
 109  
 110      /**
 111       * List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values.
 112       *
 113       * @since 3.4.0
 114       * @var array
 115       */
 116      public $choices = array();
 117  
 118      /**
 119       * List of custom input attributes for control output, where attribute names are the keys and values are the values.
 120       *
 121       * Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types.
 122       *
 123       * @since 4.0.0
 124       * @var array
 125       */
 126      public $input_attrs = array();
 127  
 128      /**
 129       * Show UI for adding new content, currently only used for the dropdown-pages control.
 130       *
 131       * @since 4.7.0
 132       * @var bool
 133       */
 134      public $allow_addition = false;
 135  
 136      /**
 137       * @deprecated It is better to just call the json() method
 138       * @since 3.4.0
 139       * @var array
 140       */
 141      public $json = array();
 142  
 143      /**
 144       * Control's Type.
 145       *
 146       * @since 3.4.0
 147       * @var string
 148       */
 149      public $type = 'text';
 150  
 151      /**
 152       * Callback.
 153       *
 154       * @since 4.0.0
 155       *
 156       * @see WP_Customize_Control::active()
 157       *
 158       * @var callable Callback is called with one argument, the instance of
 159       *               WP_Customize_Control, and returns bool to indicate whether
 160       *               the control is active (such as it relates to the URL
 161       *               currently being previewed).
 162       */
 163      public $active_callback = '';
 164  
 165      /**
 166       * Constructor.
 167       *
 168       * Supplied `$args` override class property defaults.
 169       *
 170       * If `$args['settings']` is not defined, use the $id as the setting ID.
 171       *
 172       * @since 3.4.0
 173       *
 174       * @param WP_Customize_Manager $manager Customizer bootstrap instance.
 175       * @param string               $id      Control ID.
 176       * @param array                $args    {
 177       *     Optional. Arguments to override class property defaults.
 178       *
 179       *     @type int                  $instance_number Order in which this instance was created in relation
 180       *                                                 to other instances.
 181       *     @type WP_Customize_Manager $manager         Customizer bootstrap instance.
 182       *     @type string               $id              Control ID.
 183       *     @type array                $settings        All settings tied to the control. If undefined, `$id` will
 184       *                                                 be used.
 185       *     @type string               $setting         The primary setting for the control (if there is one).
 186       *                                                 Default 'default'.
 187       *     @type int                  $priority        Order priority to load the control. Default 10.
 188       *     @type string               $section         Section the control belongs to. Default empty.
 189       *     @type string               $label           Label for the control. Default empty.
 190       *     @type string               $description     Description for the control. Default empty.
 191       *     @type array                $choices         List of choices for 'radio' or 'select' type controls, where
 192       *                                                 values are the keys, and labels are the values.
 193       *                                                 Default empty array.
 194       *     @type array                $input_attrs     List of custom input attributes for control output, where
 195       *                                                 attribute names are the keys and values are the values. Not
 196       *                                                 used for 'checkbox', 'radio', 'select', 'textarea', or
 197       *                                                 'dropdown-pages' control types. Default empty array.
 198       *     @type array                $json            Deprecated. Use WP_Customize_Control::json() instead.
 199       *     @type string               $type            Control type. Core controls include 'text', 'checkbox',
 200       *                                                 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional
 201       *                                                 input types such as 'email', 'url', 'number', 'hidden', and
 202       *                                                 'date' are supported implicitly. Default 'text'.
 203       * }
 204       */
 205  	public function __construct( $manager, $id, $args = array() ) {
 206          $keys = array_keys( get_object_vars( $this ) );
 207          foreach ( $keys as $key ) {
 208              if ( isset( $args[ $key ] ) ) {
 209                  $this->$key = $args[ $key ];
 210              }
 211          }
 212  
 213          $this->manager = $manager;
 214          $this->id      = $id;
 215          if ( empty( $this->active_callback ) ) {
 216              $this->active_callback = array( $this, 'active_callback' );
 217          }
 218          self::$instance_count += 1;
 219          $this->instance_number = self::$instance_count;
 220  
 221          // Process settings.
 222          if ( ! isset( $this->settings ) ) {
 223              $this->settings = $id;
 224          }
 225  
 226          $settings = array();
 227          if ( is_array( $this->settings ) ) {
 228              foreach ( $this->settings as $key => $setting ) {
 229                  $settings[ $key ] = $this->manager->get_setting( $setting );
 230              }
 231          } elseif ( is_string( $this->settings ) ) {
 232              $this->setting       = $this->manager->get_setting( $this->settings );
 233              $settings['default'] = $this->setting;
 234          }
 235          $this->settings = $settings;
 236      }
 237  
 238      /**
 239       * Enqueue control related scripts/styles.
 240       *
 241       * @since 3.4.0
 242       */
 243  	public function enqueue() {}
 244  
 245      /**
 246       * Check whether control is active to current Customizer preview.
 247       *
 248       * @since 4.0.0
 249       *
 250       * @return bool Whether the control is active to the current preview.
 251       */
 252  	final public function active() {
 253          $control = $this;
 254          $active  = call_user_func( $this->active_callback, $this );
 255  
 256          /**
 257           * Filters response of WP_Customize_Control::active().
 258           *
 259           * @since 4.0.0
 260           *
 261           * @param bool                 $active  Whether the Customizer control is active.
 262           * @param WP_Customize_Control $control WP_Customize_Control instance.
 263           */
 264          $active = apply_filters( 'customize_control_active', $active, $control );
 265  
 266          return $active;
 267      }
 268  
 269      /**
 270       * Default callback used when invoking WP_Customize_Control::active().
 271       *
 272       * Subclasses can override this with their specific logic, or they may
 273       * provide an 'active_callback' argument to the constructor.
 274       *
 275       * @since 4.0.0
 276       *
 277       * @return true Always true.
 278       */
 279  	public function active_callback() {
 280          return true;
 281      }
 282  
 283      /**
 284       * Fetch a setting's value.
 285       * Grabs the main setting by default.
 286       *
 287       * @since 3.4.0
 288       *
 289       * @param string $setting_key
 290       * @return mixed The requested setting's value, if the setting exists.
 291       */
 292  	final public function value( $setting_key = 'default' ) {
 293          if ( isset( $this->settings[ $setting_key ] ) ) {
 294              return $this->settings[ $setting_key ]->value();
 295          }
 296      }
 297  
 298      /**
 299       * Refresh the parameters passed to the JavaScript via JSON.
 300       *
 301       * @since 3.4.0
 302       */
 303  	public function to_json() {
 304          $this->json['settings'] = array();
 305          foreach ( $this->settings as $key => $setting ) {
 306              $this->json['settings'][ $key ] = $setting->id;
 307          }
 308  
 309          $this->json['type']           = $this->type;
 310          $this->json['priority']       = $this->priority;
 311          $this->json['active']         = $this->active();
 312          $this->json['section']        = $this->section;
 313          $this->json['content']        = $this->get_content();
 314          $this->json['label']          = $this->label;
 315          $this->json['description']    = $this->description;
 316          $this->json['instanceNumber'] = $this->instance_number;
 317  
 318          if ( 'dropdown-pages' === $this->type ) {
 319              $this->json['allow_addition'] = $this->allow_addition;
 320          }
 321      }
 322  
 323      /**
 324       * Get the data to export to the client via JSON.
 325       *
 326       * @since 4.1.0
 327       *
 328       * @return array Array of parameters passed to the JavaScript.
 329       */
 330  	public function json() {
 331          $this->to_json();
 332          return $this->json;
 333      }
 334  
 335      /**
 336       * Checks if the user can use this control.
 337       *
 338       * Returns false if the user cannot manipulate one of the associated settings,
 339       * or if one of the associated settings does not exist. Also returns false if
 340       * the associated section does not exist or if its capability check returns
 341       * false.
 342       *
 343       * @since 3.4.0
 344       *
 345       * @return bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true.
 346       */
 347  	final public function check_capabilities() {
 348          if ( ! empty( $this->capability ) && ! current_user_can( $this->capability ) ) {
 349              return false;
 350          }
 351  
 352          foreach ( $this->settings as $setting ) {
 353              if ( ! $setting || ! $setting->check_capabilities() ) {
 354                  return false;
 355              }
 356          }
 357  
 358          $section = $this->manager->get_section( $this->section );
 359          if ( isset( $section ) && ! $section->check_capabilities() ) {
 360              return false;
 361          }
 362  
 363          return true;
 364      }
 365  
 366      /**
 367       * Get the control's content for insertion into the Customizer pane.
 368       *
 369       * @since 4.1.0
 370       *
 371       * @return string Contents of the control.
 372       */
 373  	final public function get_content() {
 374          ob_start();
 375          $this->maybe_render();
 376          return trim( ob_get_clean() );
 377      }
 378  
 379      /**
 380       * Check capabilities and render the control.
 381       *
 382       * @since 3.4.0
 383       * @uses WP_Customize_Control::render()
 384       */
 385  	final public function maybe_render() {
 386          if ( ! $this->check_capabilities() ) {
 387              return;
 388          }
 389  
 390          /**
 391           * Fires just before the current Customizer control is rendered.
 392           *
 393           * @since 3.4.0
 394           *
 395           * @param WP_Customize_Control $this WP_Customize_Control instance.
 396           */
 397          do_action( 'customize_render_control', $this );
 398  
 399          /**
 400           * Fires just before a specific Customizer control is rendered.
 401           *
 402           * The dynamic portion of the hook name, `$this->id`, refers to
 403           * the control ID.
 404           *
 405           * @since 3.4.0
 406           *
 407           * @param WP_Customize_Control $this WP_Customize_Control instance.
 408           */
 409          do_action( "customize_render_control_{$this->id}", $this );
 410  
 411          $this->render();
 412      }
 413  
 414      /**
 415       * Renders the control wrapper and calls $this->render_content() for the internals.
 416       *
 417       * @since 3.4.0
 418       */
 419  	protected function render() {
 420          $id    = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );
 421          $class = 'customize-control customize-control-' . $this->type;
 422  
 423          printf( '<li id="%s" class="%s">', esc_attr( $id ), esc_attr( $class ) );
 424          $this->render_content();
 425          echo '</li>';
 426      }
 427  
 428      /**
 429       * Get the data link attribute for a setting.
 430       *
 431       * @since 3.4.0
 432       * @since 4.9.0 Return a `data-customize-setting-key-link` attribute if a setting is not registered for the supplied setting key.
 433       *
 434       * @param string $setting_key
 435       * @return string Data link parameter, a `data-customize-setting-link` attribute if the `$setting_key` refers to a pre-registered setting,
 436       *                and a `data-customize-setting-key-link` attribute if the setting is not yet registered.
 437       */
 438  	public function get_link( $setting_key = 'default' ) {
 439          if ( isset( $this->settings[ $setting_key ] ) && $this->settings[ $setting_key ] instanceof WP_Customize_Setting ) {
 440              return 'data-customize-setting-link="' . esc_attr( $this->settings[ $setting_key ]->id ) . '"';
 441          } else {
 442              return 'data-customize-setting-key-link="' . esc_attr( $setting_key ) . '"';
 443          }
 444      }
 445  
 446      /**
 447       * Render the data link attribute for the control's input element.
 448       *
 449       * @since 3.4.0
 450       * @uses WP_Customize_Control::get_link()
 451       *
 452       * @param string $setting_key
 453       */
 454  	public function link( $setting_key = 'default' ) {
 455          echo $this->get_link( $setting_key );
 456      }
 457  
 458      /**
 459       * Render the custom attributes for the control's input element.
 460       *
 461       * @since 4.0.0
 462       */
 463  	public function input_attrs() {
 464          foreach ( $this->input_attrs as $attr => $value ) {
 465              echo $attr . '="' . esc_attr( $value ) . '" ';
 466          }
 467      }
 468  
 469      /**
 470       * Render the control's content.
 471       *
 472       * Allows the content to be overridden without having to rewrite the wrapper in `$this::render()`.
 473       *
 474       * Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`.
 475       * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly.
 476       *
 477       * Control content can alternately be rendered in JS. See WP_Customize_Control::print_template().
 478       *
 479       * @since 3.4.0
 480       */
 481  	protected function render_content() {
 482          $input_id         = '_customize-input-' . $this->id;
 483          $description_id   = '_customize-description-' . $this->id;
 484          $describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : '';
 485          switch ( $this->type ) {
 486              case 'checkbox':
 487                  ?>
 488                  <span class="customize-inside-control-row">
 489                      <input
 490                          id="<?php echo esc_attr( $input_id ); ?>"
 491                          <?php echo $describedby_attr; ?>
 492                          type="checkbox"
 493                          value="<?php echo esc_attr( $this->value() ); ?>"
 494                          <?php $this->link(); ?>
 495                          <?php checked( $this->value() ); ?>
 496                      />
 497                      <label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $this->label ); ?></label>
 498                      <?php if ( ! empty( $this->description ) ) : ?>
 499                          <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
 500                      <?php endif; ?>
 501                  </span>
 502                  <?php
 503                  break;
 504              case 'radio':
 505                  if ( empty( $this->choices ) ) {
 506                      return;
 507                  }
 508  
 509                  $name = '_customize-radio-' . $this->id;
 510                  ?>
 511                  <?php if ( ! empty( $this->label ) ) : ?>
 512                      <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
 513                  <?php endif; ?>
 514                  <?php if ( ! empty( $this->description ) ) : ?>
 515                      <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
 516                  <?php endif; ?>
 517  
 518                  <?php foreach ( $this->choices as $value => $label ) : ?>
 519                      <span class="customize-inside-control-row">
 520                          <input
 521                              id="<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>"
 522                              type="radio"
 523                              <?php echo $describedby_attr; ?>
 524                              value="<?php echo esc_attr( $value ); ?>"
 525                              name="<?php echo esc_attr( $name ); ?>"
 526                              <?php $this->link(); ?>
 527                              <?php checked( $this->value(), $value ); ?>
 528                              />
 529                          <label for="<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>"><?php echo esc_html( $label ); ?></label>
 530                      </span>
 531                  <?php endforeach; ?>
 532                  <?php
 533                  break;
 534              case 'select':
 535                  if ( empty( $this->choices ) ) {
 536                      return;
 537                  }
 538  
 539                  ?>
 540                  <?php if ( ! empty( $this->label ) ) : ?>
 541                      <label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
 542                  <?php endif; ?>
 543                  <?php if ( ! empty( $this->description ) ) : ?>
 544                      <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
 545                  <?php endif; ?>
 546  
 547                  <select id="<?php echo esc_attr( $input_id ); ?>" <?php echo $describedby_attr; ?> <?php $this->link(); ?>>
 548                      <?php
 549                      foreach ( $this->choices as $value => $label ) {
 550                          echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>';
 551                      }
 552                      ?>
 553                  </select>
 554                  <?php
 555                  break;
 556              case 'textarea':
 557                  ?>
 558                  <?php if ( ! empty( $this->label ) ) : ?>
 559                      <label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
 560                  <?php endif; ?>
 561                  <?php if ( ! empty( $this->description ) ) : ?>
 562                      <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
 563                  <?php endif; ?>
 564                  <textarea
 565                      id="<?php echo esc_attr( $input_id ); ?>"
 566                      rows="5"
 567                      <?php echo $describedby_attr; ?>
 568                      <?php $this->input_attrs(); ?>
 569                      <?php $this->link(); ?>
 570                  ><?php echo esc_textarea( $this->value() ); ?></textarea>
 571                  <?php
 572                  break;
 573              case 'dropdown-pages':
 574                  ?>
 575                  <?php if ( ! empty( $this->label ) ) : ?>
 576                      <label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
 577                  <?php endif; ?>
 578                  <?php if ( ! empty( $this->description ) ) : ?>
 579                      <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
 580                  <?php endif; ?>
 581  
 582                  <?php
 583                  $dropdown_name     = '_customize-dropdown-pages-' . $this->id;
 584                  $show_option_none  = __( '&mdash; Select &mdash;' );
 585                  $option_none_value = '0';
 586                  $dropdown          = wp_dropdown_pages(
 587                      array(
 588                          'name'              => $dropdown_name,
 589                          'echo'              => 0,
 590                          'show_option_none'  => $show_option_none,
 591                          'option_none_value' => $option_none_value,
 592                          'selected'          => $this->value(),
 593                      )
 594                  );
 595                  if ( empty( $dropdown ) ) {
 596                      $dropdown  = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) );
 597                      $dropdown .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $option_none_value ), esc_html( $show_option_none ) );
 598                      $dropdown .= '</select>';
 599                  }
 600  
 601                  // Hackily add in the data link parameter.
 602                  $dropdown = str_replace( '<select', '<select ' . $this->get_link() . ' id="' . esc_attr( $input_id ) . '" ' . $describedby_attr, $dropdown );
 603  
 604                  // Even more hacikly add auto-draft page stubs.
 605                  // @todo Eventually this should be removed in favor of the pages being injected into the underlying get_pages() call. See <https://github.com/xwp/wp-customize-posts/pull/250>.
 606                  $nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' );
 607                  if ( $nav_menus_created_posts_setting && current_user_can( 'publish_pages' ) ) {
 608                      $auto_draft_page_options = '';
 609                      foreach ( $nav_menus_created_posts_setting->value() as $auto_draft_page_id ) {
 610                          $post = get_post( $auto_draft_page_id );
 611                          if ( $post && 'page' === $post->post_type ) {
 612                              $auto_draft_page_options .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $post->ID ), esc_html( $post->post_title ) );
 613                          }
 614                      }
 615                      if ( $auto_draft_page_options ) {
 616                          $dropdown = str_replace( '</select>', $auto_draft_page_options . '</select>', $dropdown );
 617                      }
 618                  }
 619  
 620                  echo $dropdown;
 621                  ?>
 622                  <?php if ( $this->allow_addition && current_user_can( 'publish_pages' ) && current_user_can( 'edit_theme_options' ) ) : // Currently tied to menus functionality. ?>
 623                      <button type="button" class="button-link add-new-toggle">
 624                          <?php
 625                          /* translators: %s: Add New Page label. */
 626                          printf( __( '+ %s' ), get_post_type_object( 'page' )->labels->add_new_item );
 627                          ?>
 628                      </button>
 629                      <div class="new-content-item">
 630                          <label for="create-input-<?php echo $this->id; ?>"><span class="screen-reader-text"><?php _e( 'New page title' ); ?></span></label>
 631                          <input type="text" id="create-input-<?php echo $this->id; ?>" class="create-item-input" placeholder="<?php esc_attr_e( 'New page title&hellip;' ); ?>">
 632                          <button type="button" class="button add-content"><?php _e( 'Add' ); ?></button>
 633                      </div>
 634                  <?php endif; ?>
 635                  <?php
 636                  break;
 637              default:
 638                  ?>
 639                  <?php if ( ! empty( $this->label ) ) : ?>
 640                      <label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>
 641                  <?php endif; ?>
 642                  <?php if ( ! empty( $this->description ) ) : ?>
 643                      <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
 644                  <?php endif; ?>
 645                  <input
 646                      id="<?php echo esc_attr( $input_id ); ?>"
 647                      type="<?php echo esc_attr( $this->type ); ?>"
 648                      <?php echo $describedby_attr; ?>
 649                      <?php $this->input_attrs(); ?>
 650                      <?php if ( ! isset( $this->input_attrs['value'] ) ) : ?>
 651                          value="<?php echo esc_attr( $this->value() ); ?>"
 652                      <?php endif; ?>
 653                      <?php $this->link(); ?>
 654                      />
 655                  <?php
 656                  break;
 657          }
 658      }
 659  
 660      /**
 661       * Render the control's JS template.
 662       *
 663       * This function is only run for control types that have been registered with
 664       * WP_Customize_Manager::register_control_type().
 665       *
 666       * In the future, this will also print the template for the control's container
 667       * element and be override-able.
 668       *
 669       * @since 4.1.0
 670       */
 671  	final public function print_template() {
 672          ?>
 673          <script type="text/html" id="tmpl-customize-control-<?php echo $this->type; ?>-content">
 674              <?php $this->content_template(); ?>
 675          </script>
 676          <?php
 677      }
 678  
 679      /**
 680       * An Underscore (JS) template for this control's content (but not its container).
 681       *
 682       * Class variables for this control class are available in the `data` JS object;
 683       * export custom variables by overriding WP_Customize_Control::to_json().
 684       *
 685       * @see WP_Customize_Control::print_template()
 686       *
 687       * @since 4.1.0
 688       */
 689  	protected function content_template() {}
 690  
 691  }
 692  
 693  /**
 694   * WP_Customize_Color_Control class.
 695   */
 696  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php' );
 697  
 698  /**
 699   * WP_Customize_Media_Control class.
 700   */
 701  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php' );
 702  
 703  /**
 704   * WP_Customize_Upload_Control class.
 705   */
 706  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php' );
 707  
 708  /**
 709   * WP_Customize_Image_Control class.
 710   */
 711  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php' );
 712  
 713  /**
 714   * WP_Customize_Background_Image_Control class.
 715   */
 716  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php' );
 717  
 718  /**
 719   * WP_Customize_Background_Position_Control class.
 720   */
 721  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php' );
 722  
 723  /**
 724   * WP_Customize_Cropped_Image_Control class.
 725   */
 726  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' );
 727  
 728  /**
 729   * WP_Customize_Site_Icon_Control class.
 730   */
 731  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' );
 732  
 733  /**
 734   * WP_Customize_Header_Image_Control class.
 735   */
 736  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' );
 737  
 738  /**
 739   * WP_Customize_Theme_Control class.
 740   */
 741  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' );
 742  
 743  /**
 744   * WP_Widget_Area_Customize_Control class.
 745   */
 746  require_once ( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' );
 747  
 748  /**
 749   * WP_Widget_Form_Customize_Control class.
 750   */
 751  require_once ( ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php' );
 752  
 753  /**
 754   * WP_Customize_Nav_Menu_Control class.
 755   */
 756  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php' );
 757  
 758  /**
 759   * WP_Customize_Nav_Menu_Item_Control class.
 760   */
 761  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php' );
 762  
 763  /**
 764   * WP_Customize_Nav_Menu_Location_Control class.
 765   */
 766  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php' );
 767  
 768  /**
 769   * WP_Customize_Nav_Menu_Name_Control class.
 770   *
 771   * As this file is deprecated, it will trigger a deprecation notice if instantiated. In a subsequent
 772   * release, the require_once() here will be removed and _deprecated_file() will be called if file is
 773   * required at all.
 774   *
 775   * @deprecated 4.9.0 This file is no longer used due to new menu creation UX.
 776   */
 777  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php' );
 778  
 779  /**
 780   * WP_Customize_Nav_Menu_Locations_Control class.
 781   */
 782  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php' );
 783  
 784  /**
 785   * WP_Customize_Nav_Menu_Auto_Add_Control class.
 786   */
 787  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php' );
 788  
 789  /**
 790   * WP_Customize_Date_Time_Control class.
 791   */
 792  require_once ( ABSPATH . WPINC . '/customize/class-wp-customize-date-time-control.php' );


Generated: Tue Oct 22 08:20:01 2019 Cross-referenced by PHPXref 0.7