首页>文档>Wordpress开发文档>Wordpress 函数>register_deactivation_hook()

register_deactivation_hook()

设置插件的停用挂钩。

register_deactivation_hook(string $file,callable $function)

说明(Description)

当插件被停用时,将调用“deactivate_PLUGINNAME”操作挂钩。在这个钩子的名称中,plugin name被替换为插件的名称,包括可选的子目录。例如,当插件位于wp content/plugins/sampleplugin中时/示例.php,则此钩子的名称将变为“deactivateu sampleplugin”/示例.php’.

当插件只包含一个文件并且(默认情况下)位于wp content/plugins时/示例.php此挂钩的名称将为“deactivate”_示例.php’.


参数(Parameters)

参数类型必填说明
$file(string)必需插件的文件名,包括路径。
$function(callable)必需函数挂接到“deactivate_PLUGIN”操作。

返回(Return)

无返回值

更新版本源码位置使用被使用
2.0.0wp-includes/plugin.php:80702
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索