mirror of
https://github.com/WenPai-org/wp-china-yes.git
synced 2025-08-07 14:35:20 +08:00
commit
042c2a46b0
1 changed files with 9 additions and 5 deletions
14
index.php
14
index.php
|
@ -16,6 +16,14 @@ WP_CHINA_YES::init();
|
||||||
|
|
||||||
class WP_CHINA_YES {
|
class WP_CHINA_YES {
|
||||||
public static function init() {
|
public static function init() {
|
||||||
|
add_filter('pre_http_request', array(
|
||||||
|
__CLASS__,
|
||||||
|
'pre_http_request'
|
||||||
|
), 10, 3);
|
||||||
|
$post_action = isset($_POST['action']) ? sanitize_text_field(trim($_POST['action'])) : ' ';
|
||||||
|
if( defined( 'DOING_AJAX' ) && DOING_AJAX && !in_array($post_action,array('wpcy_set_config','wpcy_get_config'))){
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (is_admin()) {
|
if (is_admin()) {
|
||||||
if (empty(get_option('wp_china_yes_options'))) {
|
if (empty(get_option('wp_china_yes_options'))) {
|
||||||
self::set_wp_option();
|
self::set_wp_option();
|
||||||
|
@ -24,10 +32,6 @@ class WP_CHINA_YES {
|
||||||
__CLASS__,
|
__CLASS__,
|
||||||
'wp_china_yes_deactivate'
|
'wp_china_yes_deactivate'
|
||||||
));
|
));
|
||||||
add_filter('pre_http_request', array(
|
|
||||||
__CLASS__,
|
|
||||||
'pre_http_request'
|
|
||||||
), 10, 3);
|
|
||||||
add_filter('plugin_row_meta', array(
|
add_filter('plugin_row_meta', array(
|
||||||
__CLASS__,
|
__CLASS__,
|
||||||
'plugin_row_meta'
|
'plugin_row_meta'
|
||||||
|
@ -198,4 +202,4 @@ EOT;
|
||||||
$options['custom_download_server'] = $custom_download_server;
|
$options['custom_download_server'] = $custom_download_server;
|
||||||
update_option("wp_china_yes_options", $options);
|
update_option("wp_china_yes_options", $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue