WP_Customize_Custom_CSS_Setting::value() WordPress Method

The WP_Customize_Custom_CSS_Setting::value() function is used to get the value of the setting. This function returns the value of the setting as a string.

WP_Customize_Custom_CSS_Setting::value() #

Fetch the value of the setting. Will return the previewed value when preview() is called.


Description

Top ↑

See also


Top ↑

Return

(string)


Top ↑

Source

File: wp-includes/customize/class-wp-customize-custom-css-setting.php

	public function value() {
		if ( $this->is_previewed ) {
			$post_value = $this->post_value( null );
			if ( null !== $post_value ) {
				return $post_value;
			}
		}
		$id_base = $this->id_data['base'];
		$value   = '';
		$post    = wp_get_custom_css_post( $this->stylesheet );
		if ( $post ) {
			$value = $post->post_content;
		}
		if ( empty( $value ) ) {
			$value = $this->default;
		}

		/** This filter is documented in wp-includes/class-wp-customize-setting.php */
		$value = apply_filters( "customize_value_{$id_base}", $value, $this );

		return $value;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.