GC_Customize_Setting::js_value()

最后更新于:2021-11-27 08:42:35

GC_Customize_Setting::js_value()

Sanitize the setting’s value for use in JavaScript.

响应

(mixed) The requested escaped value.

源文件

文件: gc-includes/class-gc-customize-setting.php

	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 GC_Customize_Setting $setting GC_Customize_Setting instance.
		 */
		$value = apply_filters( "customize_sanitize_js_{$this->id}", $this->value(), $this );

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

		return $value;
	}