is_active_sidebar

The WordPress Core is active sidebar hook.

Description

add_filter( 'is_active_sidebar', (callback) $array, (int) $int, (int) $int ); 

Parameters (3)

0. $array (callback) => array( $this, 'tally_sidebars_via_is_active_sidebar_calls' )
The array.
1. $int (int) => 10
The int.
2. $int (int) => 2
The int.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'is_active_sidebar', $array, $int, $int ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the is_active_sidebar callback 
  2. function filter_is_active_sidebar( $array, $int, $int ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'is_active_sidebar', 'filter_is_active_sidebar', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'is_active_sidebar', 'filter_is_active_sidebar', 10, 3 ); 

Defined (2)

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

/wp-includes/class-wp-customize-widgets.php  
  1. add_filter( 'is_active_sidebar', array( $this, 'tally_sidebars_via_is_active_sidebar_calls' ), 10, 2 ); 
/wp-includes/widgets.php  
  1. return apply_filters( 'is_active_sidebar', $is_active_sidebar, $index );