想要在停用wordpress插件时调用java脚本

时间:2016-03-17 07:08:52

标签: javascript php wordpress wordpress-plugin

我想调用一个具有ready函数的js文件来调用我的api。我的代码是......

<?php
.
. // rest all code.................................
.
.

/* Runs on plugin deactivation*/
register_deactivation_hook( __FILE__, 'Pushbiz_remove' );

function Pushbiz_remove() {
/* Deletes the database field */

delete_option('PushBIZ_firstCreation');
delete_option('VarPushBIZapikey');
delete_option('PushBIZRegUrl');
?>
<form id="DeactivationForm" role="form">
<input type="hidden" value="<?php echo $api=get_option( 'VarPushBIZapikey');?>" id="regapikey">
<input type="hidden" value="<?php echo $api=get_option( 'RegUrlofapi');?>" id="RegUrl">
</form>
<?php
wp_register_script( 'DeactivationJS', plugins_url( '/admin/js/deactivation.js', __FILE__ ));
wp_enqueue_script( 'DeactivationJS' );

}
?>

我无法在停用插件时调用deactivation.js。如何在停用时调用此java脚本。

0 个答案:

没有答案