register_deactivation_hook()
register_deactivation_hook( string $file, callable $fun…
register_deactivation_hook( string $file, callable $function )
设置插件的停用挂钩。
Set the deactivation hook for a plugin.
设置插件的停用挂钩。
Set the deactivation hook for a plugin.
目录锚点:#说明#参数#返回#源码#笔记
说明(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)
无返回值
源码(Source)
| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.0.0 | wp-includes/plugin.php:807 | 0 | 2 |
笔记(Notes)
实例
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

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