Title: WP_Customize_Color_Control::to_json
Published: April 25, 2014
Last modified: August 20, 2026

---

# WP_Customize_Color_Control::to_json()

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_color_control/to_json/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_customize_color_control/to_json/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_color_control/to_json/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_customize_color_control/to_json/?output_format=md#wp--skip-link--target)

Refresh the parameters passed to the JavaScript via JSON.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_customize_color_control/to_json/?output_format=md#source)󠁿

    ```php
    public function to_json() {
    	parent::to_json();
    	$this->json['statuses']     = $this->statuses;
    	$this->json['defaultValue'] = $this->setting->default;
    	$this->json['mode']         = $this->mode;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/customize/class-wp-customize-color-control.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/customize/class-wp-customize-color-control.php#L74)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/customize/class-wp-customize-color-control.php#L74-L79)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_customize_color_control/to_json/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Customize_Control::to_json()](https://developer.wordpress.org/reference/classes/wp_customize_control/to_json/)`wp-includes/class-wp-customize-control.php` |

Refreshes the parameters passed to the JavaScript via JSON.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_customize_color_control/to_json/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_customize_color_control%2Fto_json%2F)
before being able to contribute a note or feedback.