WORDPRESS插件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/liu709127859/article/details/81275147

uninstall.php

<?php
if(!defined('WP_UNINSTALL_PLUGIN'))
    die();
delete_option("yw_copyright");
delete_option("yw_copyright_text");

yw-copyright.php

<?php
/*
Plugin Name: yw-copyright
Plugin URI: http://favoriteposts.com
Description: Simple and flexible favorite buttons for any post type.
Version: 2.2.0
Author: Kyle Phillips
Domain Path: /languages/
License: GPLv2 or later.
*/
//初始化进行的操作
function yw_copyright_install(){
    update_option("yw_copyright_text","<p>请注明转载出</p>");
}
register_activation_hook(__FILE__,"yw_copyright_install");
//停止时候的操作
function yw_copyright_deactivation(){
    update_option("yw_copyright","stop");
}
register_deactivation_hook(__FILE__,"yw__copyright_deactivation");
//卸载时候执行的操作

?>

猜你喜欢

转载自blog.csdn.net/liu709127859/article/details/81275147