wpdocs_filter
Filter HookDescription
Retrieves the number of times an action has been fired during the current request.Hook Information
File Location |
wp-includes/plugin.php
View on GitHub
|
Hook Type | Filter |
Line Number | 696 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$hook_name
|
The name of the action hook. |
Usage Examples
Basic Usage
<?php
// Hook into wpdocs_filter
add_filter('wpdocs_filter', 'my_custom_filter', 10, 1);
function my_custom_filter($hook_name) {
// Your custom filtering logic here
return $hook_name;
}
Source Code Context
wp-includes/plugin.php:696
- How this hook is used in WordPress core
<?php
691 *
692 * Note: the value and extra arguments passed to the original apply_filters() call
693 * must be passed here to `$args` as an array. For example:
694 *
695 * // Old filter.
696 * return apply_filters( 'wpdocs_filter', $value, $extra_arg );
697 *
698 * // Deprecated.
699 * return apply_filters_deprecated( 'wpdocs_filter', array( $value, $extra_arg ), '4.9.0', 'wpdocs_new_filter' );
700 *
701 * @since 4.6.0
PHP Documentation
<?php
/**
* Retrieves the number of times an action has been fired during the current request.
*
* @since 2.1.0
*
* @global int[] $wp_actions Stores the number of times each action was triggered.
*
* @param string $hook_name The name of the action hook.
* @return int The number of times the action hook has been fired.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/plugin.php
Related Hooks
Related hooks will be displayed here in future updates.