customize_section_active

Filters response of WP_Customize_Section::active().

Description

apply_filters( 'customize_section_active', (bool) $active, (WP_Customize_Section) $section ); 

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.
  1. $active = apply_filters( 'customize_section_active', $active, $section ); 
  2.  
  3. if ( !empty( $active ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the customize_section_active callback 
  2. function filter_customize_section_active( $active, $section ) { 
  3. // make filter magic happen here... 
  4. return $active
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'customize_section_active', 'filter_customize_section_active', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. 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  
  1. $active = apply_filters( 'customize_section_active', $active, $section );