!
也想出现在这里? 联系我们
广告位
当前位置:首页>开发>WordPress开发手册>WordPress函数手册>【WP函数】remove_action()

【WP函数】remove_action()

remove_action() 是WordPress的核心函数,返回值为布尔值。主要用于移除一个附属于指定动作的钩子函数。并且你也可以用替代函数替换掉默认函数。remove_action()  的调用方法如下:

remove_action( string $tagcallable $function_to_removeint $priority 10 )

$tag:必填(字符串)。将要被删除的函数所连接到的动作 hook 。

$function_to_remove:必填(回调)。将要被移除的函数名称。

$priority:选填(整型)。函数最初挂载时的优先级。

该函数定义在 wp-includes/plugin.php 文件中:

function remove_action( $tag, $function_to_remove, $priority = 10 ) {
    return remove_filter( $tag, $function_to_remove, $priority );
}

参考文档:https://developer.wordpress.org/reference/functions/remove_action

给TA打赏
共{{data.count}}人
人已打赏
WordPress函数手册

【WP函数】do_action()

2022-5-29 15:36:22

WordPress函数手册

【WP函数】wp_register_script()

2022-5-29 16:01:29

声明 本站上的部份代码及教程来源于互联网,仅供网友学习交流,若您喜欢本文可附上原文链接随意转载。无意侵害您的权益,请发送邮件至 [email protected] 或点击右侧 私信:林沐阳 反馈,我们将尽快处理。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索