Filter hook 'sidebars_widgets'

in WP Core File wp-includes/widgets.php at line 1051

View Source

sidebars_widgets

Filter Hook
Description
Filters the list of sidebars and their widgets.

Hook Information

File Location wp-includes/widgets.php View on GitHub
Hook Type Filter
Line Number 1051

Hook Parameters

Type Name Description
array $sidebars_widgets An associative array of sidebars and their widgets.

Usage Examples

Basic Usage
<?php
// Hook into sidebars_widgets
add_filter('sidebars_widgets', 'my_custom_filter', 10, 1);

function my_custom_filter($sidebars_widgets) {
    // Your custom filtering logic here
    return $sidebars_widgets;
}

Source Code Context

wp-includes/widgets.php:1051 - How this hook is used in WordPress core
<?php
1046  	 *
1047  	 * @since 2.7.0
1048  	 *
1049  	 * @param array $sidebars_widgets An associative array of sidebars and their widgets.
1050  	 */
1051  	return apply_filters( 'sidebars_widgets', $sidebars_widgets );
1052  }
1053  
1054  /**
1055   * Retrieves the registered sidebar with the given ID.
1056   *

PHP Documentation

<?php
/**
	 * Filters the list of sidebars and their widgets.
	 *
	 * @since 2.7.0
	 *
	 * @param array $sidebars_widgets An associative array of sidebars and their widgets.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/widgets.php
Related Hooks

Related hooks will be displayed here in future updates.