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

Filters the arguments for the Archives widget.

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

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

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

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

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

WP_Widget_Archives::widget()
widget_archives_args
render_block_core_archives()
widget_archives_args
wp-includes/widgets/class-wp-widget-archives.php 152-159
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,
	)
);

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

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