[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentytwentyone/classes/ -> class-twenty-twenty-one-customize-color-control.php (source)

   1  <?php
   2  /**
   3   * Customize API: WP_Customize_Color_Control class
   4   *
   5   * @package WordPress
   6   * @subpackage Twenty_Twenty_One
   7   * @since 1.0.0
   8   */
   9  
  10  /**
  11   * Customize Color Control class.
  12   *
  13   * @since 1.0.0
  14   *
  15   * @see WP_Customize_Control
  16   */
  17  class Twenty_Twenty_One_Customize_Color_Control extends WP_Customize_Color_Control {
  18      /**
  19       * The control type.
  20       *
  21       * @since 1.0.0
  22       *
  23       * @var string
  24       */
  25      public $type = 'twenty-twenty-one-color';
  26  
  27      /**
  28       * Colorpicker palette
  29       *
  30       * @access public
  31       *
  32       * @since 1.0.0
  33       *
  34       * @var array
  35       */
  36      public $palette;
  37  
  38      /**
  39       * Enqueue control related scripts/styles.
  40       *
  41       * @access public
  42       *
  43       * @since 1.0.0
  44       *
  45       * @return void
  46       */
  47  	public function enqueue() {
  48          parent::enqueue();
  49  
  50          // Enqueue the script.
  51          wp_enqueue_script(
  52              'twentytwentyone-control-color',
  53              get_theme_file_uri( 'assets/js/palette-colorpicker.js' ),
  54              array( 'customize-controls', 'jquery', 'customize-base', 'wp-color-picker' ),
  55              (string) filemtime( get_theme_file_path( 'assets/js/palette-colorpicker.js' ) ),
  56              false
  57          );
  58      }
  59  
  60      /**
  61       * Refresh the parameters passed to the JavaScript via JSON.
  62       *
  63       * @access public
  64       *
  65       * @since 1.0.0
  66       *
  67       * @uses WP_Customize_Control::to_json()
  68       *
  69       * @return void
  70       */
  71  	public function to_json() {
  72          parent::to_json();
  73          $this->json['palette'] = $this->palette;
  74      }
  75  }


Generated : Thu Nov 26 08:20:02 2020 Cross-referenced by PHPXref