wppaste
WordPress

WP_Customize_Color_Control

Since
3.4.0
Source
wp-includes/customize/class-wp-customize-color-control.php:17
Customize Color Control class.

Compatibility

WordPress
since 3.4.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 3

$typestringpublic
Type.
$statusesarraypublic
Statuses.
$modestringpublic
Mode.

Methods · 5

Source code

class WP_Customize_Color_Control extends WP_Customize_Control {	/**	 * Type.	 *	 * @var string	 */	public $type = 'color'; 	/**	 * Statuses.	 *	 * @var array	 */	public $statuses; 	/**	 * Mode.	 *	 * @since 4.7.0	 * @var string	 */	public $mode = 'full'; 	/**	 * Constructor.	 *	 * @since 3.4.0	 *	 * @see WP_Customize_Control::__construct()	 *	 * @param WP_Customize_Manager $manager Customizer bootstrap instance.	 * @param string               $id      Control ID.	 * @param array                $args    Optional. Arguments to override class property defaults.	 *                                      See WP_Customize_Control::__construct() for information	 *                                      on accepted arguments. Default empty array.	 */	public function __construct( $manager, $id, $args = array() ) {		$this->statuses = array( '' => __( 'Default' ) );		parent::__construct( $manager, $id, $args );	} 	/**	 * Enqueue scripts/styles for the color picker.	 *	 * @since 3.4.0	 */	public function enqueue() {		wp_enqueue_script( 'wp-color-picker' );		wp_enqueue_style( 'wp-color-picker' );	} 	/**	 * Refresh the parameters passed to the JavaScript via JSON.	 *	 * @since 3.4.0	 * @uses WP_Customize_Control::to_json()	 */	public function to_json() {		parent::to_json();		$this->json['statuses']     = $this->statuses;		$this->json['defaultValue'] = $this->setting->default;		$this->json['mode']         = $this->mode;	} 	/**	 * Don't render the control content from PHP, as it's rendered via JS on load.	 *	 * @since 3.4.0	 */	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 = '#RRGGBB',

Changelog

Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/customize/class-wp-customize-color-control.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.