customize_control_active
Filters response of WP_Customize_Control::active().
Description
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.
- $active = apply_filters( 'customize_control_active', $active, $control );
- if ( !empty( $active ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the customize_control_active callback
- function filter_customize_control_active( $active, $control ) {
- // make filter magic happen here...
- return $active;
- };
- // add the filter
- add_filter( 'customize_control_active', 'filter_customize_control_active', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- 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
- $active = apply_filters( 'customize_control_active', $active, $control );