函数原型
register_deactivation_hook( string $file, callable $callback )
函数描述
Sets the deactivation hook for a plugin.
是否弃用
未弃用
函数参数
-
$file
string
Required - The filename of the plugin including the path.
-
$callback
callable
Required - The function hooked to the
'deactivate_PLUGIN'action.
函数返回值
无
函数位置
File: wp-includes/plugin.php.
函数源码
function register_deactivation_hook( $file, $callback ) {
$file = plugin_basename( $file );
add_action( 'deactivate_' . $file, $callback );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |

