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

---

# WP_Customize_Section::active(): bool

## In this article

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

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

Check whether section is active to current Customizer preview.

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

 bool Whether the section is active to the current preview.

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

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

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

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

 [apply_filters( ‘customize_section_active’, bool $active, WP_Customize_Section $section )](https://developer.wordpress.org/reference/hooks/customize_section_active/)

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

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_customize_section/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_Section::json()](https://developer.wordpress.org/reference/classes/wp_customize_section/json/)`wp-includes/class-wp-customize-section.php` |

Gather the parameters passed to client JavaScript via JSON.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_customize_section/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_section%2Factive%2F)
before being able to contribute a note or feedback.