widget_archives_args
Filter HookDescription
Filters the arguments for the Archives widget.Hook Information
File Location |
wp-includes/widgets/class-wp-widget-archives.php
View on GitHub
|
Hook Type | Filter |
Line Number | 152 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$args
|
An array of Archives option arguments. |
array
|
$instance
|
Array of settings for the current widget. |
Usage Examples
Basic Usage
<?php
// Hook into widget_archives_args
add_filter('widget_archives_args', 'my_custom_filter', 10, 2);
function my_custom_filter($args, $instance) {
// Your custom filtering logic here
return $args;
}
Source Code Context
wp-includes/widgets/class-wp-widget-archives.php:152
- How this hook is used in WordPress core
<?php
147 * @see wp_get_archives()
148 *
149 * @param array $args An array of Archives option arguments.
150 * @param array $instance Array of settings for the current widget.
151 */
152 apply_filters(
153 'widget_archives_args',
154 array(
155 'type' => 'monthly',
156 'show_post_count' => $count,
157 ),
PHP Documentation
<?php
/**
* Filters the arguments for the Archives widget.
*
* @since 2.8.0
* @since 4.9.0 Added the `$instance` parameter.
*
* @see wp_get_archives()
*
* @param array $args An array of Archives option arguments.
* @param array $instance Array of settings for the current widget.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/widgets/class-wp-widget-archives.php
Related Hooks
Related hooks will be displayed here in future updates.