customizer_widgets_section_args

Filters Customizer widget section arguments for a given sidebar.

Description

apply_filters( 'customizer_widgets_section_args', (array) $section_args, (string) $section_id, (int|string) $sidebar_id ); 

Parameters (3)

0. $section_args (array)
Array of Customizer widget section arguments.
1. $section_id (string)
Customizer section ID.
2. $sidebar_id (int|string)
The sidebar id.

Usage

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

Defined (1)

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

/wp-includes/class-wp-customize-widgets.php  
  1. $section_args = apply_filters( 'customizer_widgets_section_args', $section_args, $section_id, $sidebar_id );