From 47223ef715753336dcfa1aa0b9a8037dd1cda035 Mon Sep 17 00:00:00 2001 From: sunxiyuan Date: Mon, 27 Apr 2020 13:21:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8F=92=E4=BB=B6=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=A1=E6=81=AF=E5=88=9D=E5=A7=8B=E5=8C=96=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/index.php b/index.php index e676265..9751249 100644 --- a/index.php +++ b/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'); }