widget_categories_dropdown_args
Filter HookDescription
Filters the arguments for the Categories widget drop-down.Hook Information
File Location |
wp-includes/widgets/class-wp-widget-categories.php
View on GitHub
|
Hook Type | Filter |
Line Number | 91 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$cat_args
|
An array of Categories widget drop-down arguments. |
array
|
$instance
|
Array of settings for the current widget. |
Usage Examples
Basic Usage
<?php
// Hook into widget_categories_dropdown_args
add_filter('widget_categories_dropdown_args', 'my_custom_filter', 10, 2);
function my_custom_filter($cat_args, $instance) {
// Your custom filtering logic here
return $cat_args;
}
Source Code Context
wp-includes/widgets/class-wp-widget-categories.php:91
- How this hook is used in WordPress core
<?php
86 * @see wp_dropdown_categories()
87 *
88 * @param array $cat_args An array of Categories widget drop-down arguments.
89 * @param array $instance Array of settings for the current widget.
90 */
91 wp_dropdown_categories( apply_filters( 'widget_categories_dropdown_args', $cat_args, $instance ) );
92
93 echo '</form>';
94
95 ob_start();
96 ?>
PHP Documentation
<?php
/**
* Filters the arguments for the Categories widget drop-down.
*
* @since 2.8.0
* @since 4.9.0 Added the `$instance` parameter.
*
* @see wp_dropdown_categories()
*
* @param array $cat_args An array of Categories widget drop-down 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-categories.php
Related Hooks
Related hooks will be displayed here in future updates.