deprecated_hook_run
云策文档标注
概述
deprecated_hook_run 是一个 WordPress 动作钩子,在调用已弃用的钩子时触发,用于通知开发者相关变更。
关键要点
- 触发时机:当调用已弃用的钩子时自动触发。
- 参数:$hook(被调用的钩子名)、$replacement(应使用的替代钩子)、$version(弃用该钩子的 WordPress 版本)、$message(变更相关消息)。
- 相关函数:与 _deprecated_hook() 函数关联,用于标记弃用钩子并抛出通知。
- 版本历史:自 WordPress 4.6.0 版本引入。
原文内容
Fires when a deprecated hook is called.
Parameters
$hookstring-
The hook that was called.
$replacementstring-
The hook that should be used as a replacement.
$versionstring-
The version of WordPress that deprecated the argument used.
$messagestring-
A message regarding the change.
Source
do_action( 'deprecated_hook_run', $hook, $replacement, $version, $message );
Changelog
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |