mirror of
https://github.com/WenPai-org/wp-china-yes.git
synced 2025-08-06 21:53:56 +08:00
优化插件配置信息初始化方法
This commit is contained in:
parent
e982d6d1e6
commit
47223ef715
1 changed files with 3 additions and 12 deletions
15
index.php
15
index.php
|
@ -17,10 +17,9 @@ WP_CHINA_YES::init();
|
|||
class WP_CHINA_YES {
|
||||
public static function init() {
|
||||
if (is_admin()) {
|
||||
register_activation_hook(WP_CHINA_YES_BASE_FILE, array(
|
||||
__CLASS__,
|
||||
'wp_china_yes_activate'
|
||||
));
|
||||
if (empty(get_option('wp_china_yes_options'))) {
|
||||
self::set_wp_option();
|
||||
}
|
||||
register_deactivation_hook(WP_CHINA_YES_BASE_FILE, array(
|
||||
__CLASS__,
|
||||
'wp_china_yes_deactivate'
|
||||
|
@ -57,17 +56,9 @@ class WP_CHINA_YES {
|
|||
__CLASS__,
|
||||
'sponsor_widget'
|
||||
));
|
||||
|
||||
if (empty(get_option('wp_china_yes_options'))) {
|
||||
self::wp_china_yes_activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function wp_china_yes_activate() {
|
||||
self::set_wp_option();
|
||||
}
|
||||
|
||||
public static function wp_china_yes_deactivate() {
|
||||
delete_option('wp_china_yes_options');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue