Title: WP_Customize_Panel::active
Published: December 18, 2014
Last modified: April 28, 2025

---

# WP_Customize_Panel::active(): bool

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#wp--skip-link--target)

Check whether panel is active to current Customizer preview.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#return)󠁿

 bool Whether the panel is active to the current preview.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#source)󠁿

    ```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;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-panel.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-customize-panel.php#L188)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-customize-panel.php#L188-L203)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#hooks)󠁿

 [apply_filters( ‘customize_panel_active’, bool $active, WP_Customize_Panel $panel )](https://developer.wordpress.org/reference/hooks/customize_panel_active/)

Filters response of [WP_Customize_Panel::active()](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/).

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#related)󠁿

| Uses | Description | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

| Used by | Description | 
| [WP_Customize_Panel::json()](https://developer.wordpress.org/reference/classes/wp_customize_panel/json/)`wp-includes/class-wp-customize-panel.php` |

Gather the parameters passed to client JavaScript via JSON.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_customize_panel/active/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_customize_panel%2Factive%2F)
before being able to contribute a note or feedback.