首页 WordPress函数大全 register_deactivation_hook()

register_deactivation_hook()

2020-05-02 / 2425阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

register_deactivation_hook( string $file, callable $function )

设置插件的停用挂钩。

描述

停用插件后,将调用操作“ deactivate_PLUGINNAME”挂钩。在该钩子的名称中,PLUGINNAME被替换为插件的名称,包括可选的子目录。例如,当插件位于wp-content / plugins / sampleplugin / sample.php中时,该钩子的名称将变为'deactivate_sampleplugin / sample.php'。

当插件包含>

参数

$file

(string)
(Required)
The filename of the plugin including the path.

$function

(callable)
(Required)
The function hooked to the 'deactivate_PLUGIN' action.

大家谈论
    我的见解