dynamic_sidebar_params filter-hookWP 2.5.0

Filters the parameters passed to a widget's display callback.

Note: The filter is evaluated on both the front end and back end, including for the Inactive Widgets sidebar on the Widgets screen.

Usage

add_filter( 'dynamic_sidebar_params', 'wp_kama_dynamic_sidebar_params_filter' );

/**
 * Function for `dynamic_sidebar_params` filter-hook.
 * 
 * @param array $params 
 *
 * @return array
 */
function wp_kama_dynamic_sidebar_params_filter( $params ){

	// filter...
	return $params;
}
$params(array)

-

  • args(array)
    An array of widget display arguments.

    • name(string)
      Name of the sidebar the widget is assigned to.

    • id(string)
      ID of the sidebar the widget is assigned to.

    • description(string)
      The sidebar description.

    • class(string)
      CSS class applied to the sidebar container.

    • before_widget(string)
      HTML markup to prepend to each widget in the sidebar.

    • after_widget(string)
      HTML markup to append to each widget in the sidebar.

    • before_title(string)
      HTML markup to prepend to the widget title when displayed.

    • after_title(string)
      HTML markup to append to the widget title when displayed.

    • widget_id(string)
      ID of the widget.

    • widget_name(string)
      Name of the widget.
  • widget_args(array)
    An array of multi-widget arguments.

    • number(int)
      Number increment used for multiples of the same widget.

Changelog

Since 2.5.0 Introduced.

Where the hook is called

dynamic_sidebar()
dynamic_sidebar_params
wp_render_widget()
dynamic_sidebar_params
wp-includes/widgets.php 805
$params = apply_filters( 'dynamic_sidebar_params', $params );
wp-includes/widgets.php 2023
$params = apply_filters( 'dynamic_sidebar_params', $params );

Where the hook is used in WordPress

wp-admin/includes/widgets.php 88
add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );
wp-includes/class-wp-customize-widgets.php 1776
add_filter( 'dynamic_sidebar_params', array( $this, 'filter_dynamic_sidebar_params' ) );