WP_Customize_Section::active() WordPress Method

The WP_Customize_Section::active() method is used to check if a section is currently active in the Customizer. This is useful for determining whether the current section should be displayed or not.

WP_Customize_Section::active() #

Check whether section is active to current Customizer preview.


Return

(bool) Whether the section is active to the current preview.


Top ↑

Source

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

	final public function active() {
		$section = $this;
		$active  = call_user_func( $this->active_callback, $this );

		/**
		 * Filters response of WP_Customize_Section::active().
		 *
		 * @since 4.1.0
		 *
		 * @param bool                 $active  Whether the Customizer section is active.
		 * @param WP_Customize_Section $section WP_Customize_Section instance.
		 */
		$active = apply_filters( 'customize_section_active', $active, $section );

		return $active;
	}


Top ↑

Changelog

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