did_action()
did_action( string $tag ) 检索触发操作的次数。Retrieve the number…
did_action( string $tag )
检索触发操作的次数。
Retrieve the number of times an action is fired.
检索触发操作的次数。
Retrieve the number of times an action is fired.
目录锚点:#参数#返回#源码#笔记
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $tag | (string) | 必需 | 动作挂钩的名称。 |
返回(Return)
(int)触发action hook$标记的次数。
源码(Source)
/**
* Retrieve the number of times an action is fired.
*
* @since 2.1.0
*
* @global array $wp_actions Increments the amount of times action was triggered.
*
* @param string $tag The name of the action hook.
* @return int The number of times action hook $tag is fired.
*/
function did_action($tag) {
global $wp_actions;
if ( ! isset( $wp_actions[ $tag ] ) )
return 0;
return $wp_actions[$tag];
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.1.0 | wp-includes/plugin.php:493 | 36 | 0 |
笔记(Notes)
例子
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!