mirror of
https://github.com/WenPai-org/wp-china-yes.git
synced 2025-08-07 14:35:20 +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 {
|
class WP_CHINA_YES {
|
||||||
public static function init() {
|
public static function init() {
|
||||||
if (is_admin()) {
|
if (is_admin()) {
|
||||||
register_activation_hook(WP_CHINA_YES_BASE_FILE, array(
|
if (empty(get_option('wp_china_yes_options'))) {
|
||||||
__CLASS__,
|
self::set_wp_option();
|
||||||
'wp_china_yes_activate'
|
}
|
||||||
));
|
|
||||||
register_deactivation_hook(WP_CHINA_YES_BASE_FILE, array(
|
register_deactivation_hook(WP_CHINA_YES_BASE_FILE, array(
|
||||||
__CLASS__,
|
__CLASS__,
|
||||||
'wp_china_yes_deactivate'
|
'wp_china_yes_deactivate'
|
||||||
|
@ -57,17 +56,9 @@ class WP_CHINA_YES {
|
||||||
__CLASS__,
|
__CLASS__,
|
||||||
'sponsor_widget'
|
'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() {
|
public static function wp_china_yes_deactivate() {
|
||||||
delete_option('wp_china_yes_options');
|
delete_option('wp_china_yes_options');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue