widget_archives_dropdown_args filter-hookWP 2.8.0

Filters the arguments for the Archives widget drop-down.

Usage

add_filter( 'widget_archives_dropdown_args', 'wp_kama_widget_archives_dropdown_args_filter', 10, 2 );

/**
 * Function for `widget_archives_dropdown_args` filter-hook.
 * 
 * @param array $args     An array of Archives widget drop-down arguments.
 * @param array $instance Settings for the current Archives widget instance.
 *
 * @return array
 */
function wp_kama_widget_archives_dropdown_args_filter( $args, $instance ){

	// filter...
	return $args;
}
$args(array)
An array of Archives widget drop-down arguments.
$instance(array)
Settings for the current Archives widget instance.

Changelog

Since 2.8.0 Introduced.
Since 4.9.0 Added the $instance parameter.

Where the hook is called

WP_Widget_Archives::widget()
widget_archives_dropdown_args
render_block_core_archives()
widget_archives_dropdown_args
wp-includes/widgets/class-wp-widget-archives.php 76-84
$dropdown_args = apply_filters(
	'widget_archives_dropdown_args',
	array(
		'type'            => 'monthly',
		'format'          => 'option',
		'show_post_count' => $count,
	),
	$instance
);
wp-includes/blocks/archives.php 31-38
$dropdown_args = apply_filters(
	'widget_archives_dropdown_args',
	array(
		'type'            => $type,
		'format'          => 'option',
		'show_post_count' => $show_post_count,
	)
);

Where the hook is used in WordPress

Usage not found.