WP_Customize_Custom_CSS_Setting::preview() WordPress Method

The WP_Customize_Custom_CSS_Setting::preview() method is responsible for previewing the changes made to the custom CSS code for a WordPress site. This is done by updating the Custom CSS code in the WordPress Customizer with the new changes and then calling the refresh method on the WP_Customize_Manager instance.

WP_Customize_Custom_CSS_Setting::preview() #

Add filter to preview post value.


Return

(bool) False when preview short-circuits due no change needing to be previewed.


Top ↑

Source

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

	public function preview() {
		if ( $this->is_previewed ) {
			return false;
		}
		$this->is_previewed = true;
		add_filter( 'wp_get_custom_css', array( $this, 'filter_previewed_wp_get_custom_css' ), 9, 2 );
		return true;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.7.9Introduced.

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.