widget_categories_args
Filters the arguments for the Categories widget.
Использование
add_filter( 'widget_categories_args', 'wp_kama_widget_categories_args_filter', 10, 2 );
/**
* Function for `widget_categories_args` filter-hook.
*
* @param array $cat_args An array of Categories widget options.
* @param array $instance Array of settings for the current widget.
*
* @return array
*/
function wp_kama_widget_categories_args_filter( $cat_args, $instance ){
// filter...
return $cat_args;
}
- $cat_args(массив)
- An array of Categories widget options.
- $instance(массив)
- Array of settings for the current widget.
Список изменений
| С версии 2.8.0 | Введена. |
| С версии 4.9.0 | Added the $instance parameter. |
Где вызывается хук
wp-includes/widgets/class-wp-widget-categories.php 156
wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) );