widget_archives_args
Filters the arguments for the Archives widget.
Usage
add_filter( 'widget_archives_args', 'wp_kama_widget_archives_args_filter', 10, 2 ); /** * Function for `widget_archives_args` filter-hook. * * @param array $args An array of Archives option arguments. * @param array $instance Array of settings for the current widget. * * @return array */ function wp_kama_widget_archives_args_filter( $args, $instance ){ // filter... return $args; }
- $args(array)
- An array of Archives option arguments.
- $instance(array)
- Array of settings for the current widget.
Changelog
Since 2.8.0 | Introduced. |
Since 4.9.0 | Added the $instance parameter. |
Where the hook is called
widget_archives_args
wp-includes/widgets/class-wp-widget-archives.php 154-161
apply_filters( 'widget_archives_args', array( 'type' => 'monthly', 'show_post_count' => $count, ), $instance )
wp-includes/blocks/archives.php 78-84
$archives_args = apply_filters( 'widget_archives_args', array( 'type' => $type, 'show_post_count' => $show_post_count, ) );