widget_archives_dropdown_args хук-фильтрWP 2.8.0

Filters the arguments for the Archives widget drop-down.

Использование

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(массив)
An array of Archives widget drop-down arguments.
$instance(массив)
Settings for the current Archives widget instance.

Список изменений

С версии 2.8.0 Введена.
С версии 4.9.0 Added the $instance parameter.

Где вызывается хук

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 33-40
$dropdown_args = apply_filters(
	'widget_archives_dropdown_args',
	array(
		'type'            => $type,
		'format'          => 'option',
		'show_post_count' => $show_post_count,
	)
);

Где используется хук в WordPress

Использование не найдено.