customize_control_active

Filters response of WP_Customize_Control::active().

Description

apply_filters( 'customize_control_active', (bool) $active, (WP_Customize_Control) $control ); 

Parameters (2)

0. $active (bool)
Whether the Customizer control is active.
1. $control (WP_Customize_Control)
WP_Customize_Control instance.

Usage

To run the hook, copy the example below.
  1. $active = apply_filters( 'customize_control_active', $active, $control ); 
  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_control_active callback 
  2. function filter_customize_control_active( $active, $control ) { 
  3. // make filter magic happen here... 
  4. return $active
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'customize_control_active', 'filter_customize_control_active', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'customize_control_active', 'filter_customize_control_active', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/class-wp-customize-control.php  
  1. $active = apply_filters( 'customize_control_active', $active, $control );