WP_Customize_Setting::js_value() – Sanitize the setting’s value for use in JavaScript.

You appear to be a bot. Output may be restricted

Description

Sanitize the setting's value for use in JavaScript.

Usage

$mixed = WP_Customize_Setting::js_value();

Parameters

Returns

mixed The requested escaped value.

Source

File name: wordpress/wp-includes/class-wp-customize-setting.php
Lines:

1 to 20 of 20
  public function js_value() {

    
/**
 * Filters a Customize setting value for use in JavaScript.
 *
 * The dynamic portion of the hook name, `$this->id`, refers to the setting ID.
 *
 * @since 3.4.0
 *
 * @param mixed                $value   The setting value.
 * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
 */
    $value = apply_filters( "customize_sanitize_js_{$this->id}", $this->WP_Customize_Setting::value(), $this );

    if ( is_string( $value ) ) {
      return html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );
    }

    return $value;
  }
 

 View on GitHub View on Trac