W3cubDocs

/WordPress

WP_Customize_Panel::active()

Check whether panel is active to current Customizer preview.

Return

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

Source

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

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

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

		return $active;
	}

Changelog

Version Description
4.1.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_panel/active