deprecated_hook_run
Action HookDescription
Fires when a deprecated hook is called.Hook Information
File Location |
wp-includes/functions.php
View on GitHub
|
Hook Type | Action |
Line Number | 5950 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$hook
|
The hook that was called. |
string
|
$replacement
|
The hook that should be used as a replacement. |
string
|
$version
|
The version of WordPress that deprecated the argument used. |
string
|
$message
|
A message regarding the change. |
Usage Examples
Basic Usage
<?php
// Hook into deprecated_hook_run
add_action('deprecated_hook_run', 'my_custom_function', 10, 4);
function my_custom_function($hook, $replacement, $version, $message) {
// Your custom code here
}
Source Code Context
wp-includes/functions.php:5950
- How this hook is used in WordPress core
<?php
5945 * @param string $hook The hook that was called.
5946 * @param string $replacement The hook that should be used as a replacement.
5947 * @param string $version The version of WordPress that deprecated the argument used.
5948 * @param string $message A message regarding the change.
5949 */
5950 do_action( 'deprecated_hook_run', $hook, $replacement, $version, $message );
5951
5952 /**
5953 * Filters whether to trigger deprecated hook errors.
5954 *
5955 * @since 4.6.0
PHP Documentation
<?php
/**
* Fires when a deprecated hook is called.
*
* @since 4.6.0
*
* @param string $hook The hook that was called.
* @param string $replacement The hook that should be used as a replacement.
* @param string $version The version of WordPress that deprecated the argument used.
* @param string $message A message regarding the change.
*/
Quick Info
- Hook Type: Action
- Parameters: 4
- File: wp-includes/functions.php
Related Hooks
Related hooks will be displayed here in future updates.