WP_Customize_Setting::is_current_blog_previewed() WordPress Method

The WP_Customize_Setting::is_current_blog_previewed() method is used to determine if the current WordPress blog is being previewed in the Customizer. This is useful for settings that only apply to the current site, such as site title and description.

WP_Customize_Setting::is_current_blog_previewed() #

Return true if the current site is not the same as the previewed site.


Return

(bool) If preview() has been called.


Top ↑

Source

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

	public function is_current_blog_previewed() {
		if ( ! isset( $this->_previewed_blog_id ) ) {
			return false;
		}
		return ( get_current_blog_id() === $this->_previewed_blog_id );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.2.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.