customize_section_active
Filters response of WP_Customize_Section::active().
Description
Parameters (2)
- 0. $active (bool)
- Whether the Customizer section is active.
- 1. $section (WP_Customize_Section)
-
WP_Customize_Section
instance.
Usage
- To run the hook, copy the example below.
- $active = apply_filters( 'customize_section_active', $active, $section );
- if ( !empty( $active ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the customize_section_active callback
- function filter_customize_section_active( $active, $section ) {
- // make filter magic happen here...
- return $active;
- };
- // add the filter
- add_filter( 'customize_section_active', 'filter_customize_section_active', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'customize_section_active', 'filter_customize_section_active', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/class-wp-customize-section.php
- $active = apply_filters( 'customize_section_active', $active, $section );