diff --git a/class/simple_local_avatars.php b/class/simple_local_avatars.php
new file mode 100644
index 0000000..92a4519
--- /dev/null
+++ b/class/simple_local_avatars.php
@@ -0,0 +1,177 @@
+
+
+ ID;
+ elseif (is_object($id_or_email) && !empty($id_or_email->user_id)) $user_id = (int)$id_or_email->user_id;
+ if (empty($user_id)) return $avatar;
+ $local_avatars = get_user_meta($user_id, 'simple_local_avatar', true);
+ if (empty($local_avatars) || empty($local_avatars['full'])) return $avatar;
+ $size = (int)$size;
+ if (empty($alt)) $alt = get_the_author_meta('display_name', $user_id);
+ if (empty($local_avatars[$size])) {
+ $upload_path = wp_upload_dir();
+ $avatar_full_path = str_replace($upload_path['baseurl'], $upload_path['basedir'], $local_avatars['full']);
+ $image = wp_get_image_editor($avatar_full_path);
+ if (!is_wp_error($image)) {
+ $image->resize($size, $size, true);
+ $image_sized = $image->save();
+ }
+ $local_avatars[$size] = is_wp_error($image_sized) ? $local_avatars[$size] = $local_avatars['full'] : str_replace($upload_path['basedir'], $upload_path['baseurl'], $image_sized['path']);
+ update_user_meta($user_id, 'simple_local_avatar', $local_avatars);
+ } elseif (substr($local_avatars[$size], 0, 4) != 'http') {
+ $local_avatars[$size] = home_url($local_avatars[$size]);
+ }
+ $author_class = is_author($user_id) ? ' current-author' : '';
+ $avatar = "";
+ return apply_filters('simple_local_avatar', $avatar);
+ }
+ public function edit_user_profile($profileuser) {
+?>
+
@@ -98,7 +99,6 @@ switch ( $type ) {
case 'number':
?>
diff --git a/functions/advanced.php b/functions/advanced.php
new file mode 100644
index 0000000..26675fd
--- /dev/null
+++ b/functions/advanced.php
@@ -0,0 +1,29 @@
+";
+ break;
+ case 2:
+ $avatar = preg_replace("/http[s]{0,1}:\/\/(secure|www|\d).gravatar.com\/avatar\//","//cdn.v2ex.com/gravatar/",$avatar);
+ break;
+ default:
+ $avatar = preg_replace("/http[s]{0,1}:\/\/(secure|www|\d).gravatar.com\/avatar\//","//dn-qiniu-avatar.qbox.me/avatar/",$avatar);
+ }
+ return $avatar;
+}
+add_filter('get_avatar', 'gdk_switch_get_avatar');
+
+//fancybox图片灯箱效果
+function fancybox($content) {
+ $pattern = "/
]*).(bmp|gif|jpeg|jpg|png|swf)('|\")(.*?)>(.*?)<\\/a>/i";
+ $replacement = '$7';
+ $content = preg_replace($pattern, $replacement, $content);
+ return $content;
+}
+add_filter('the_content', 'fancybox');
+
+
diff --git a/functions/avatar.php b/functions/avatar.php
index 80daa6f..872cbf6 100644
--- a/functions/avatar.php
+++ b/functions/avatar.php
@@ -2,196 +2,7 @@
//头像镜像
-function get_ssl_avatar($avatar) {
- $avatar = preg_replace('/.*\/avatar\/(.*)\?s=([\d]+)&.*/','
',$avatar);
- return $avatar;
-}
-
-add_filter('get_avatar', 'get_ssl_avatar', 10, 3);
-//随机头像
-function local_random_avatar($avatar) {
- $avatarsrc = 'https://cdn.jsdelivr.net/gh/yunluo/GitCafeApi/avatar/' . mt_rand(1, 1999) . '.jpg';
- $avatar = "
";
- return $avatar;
-}
-
- add_filter('get_avatar', 'local_random_avatar', 1, 5);
-//本地头像
-class simple_local_avatars {
- private $user_id_being_edited;
- public function __construct() {
- add_action('admin_init', array(
- $this,
- 'admin_init'
- ));
- add_action('show_user_profile', array(
- $this,
- 'edit_user_profile'
- ));
- add_action('edit_user_profile', array(
- $this,
- 'edit_user_profile'
- ));
- add_action('personal_options_update', array(
- $this,
- 'edit_user_profile_update'
- ));
- add_action('edit_user_profile_update', array(
- $this,
- 'edit_user_profile_update'
- ));
- add_filter('get_avatar', array(
- $this,
- 'get_avatar'
- ) , 10, 5);
- add_filter('avatar_defaults', array(
- $this,
- 'avatar_defaults'
- ));
- }
- public function admin_init() {
- register_setting('discussion', 'simple_local_avatars_caps', array(
- $this,
- 'sanitize_options'
- ));
- add_settings_field('basic-user-avatars-caps', '本地上传头像权限管理', array(
- $this,
- 'avatar_settings_field'
- ) , 'discussion', 'avatars');
- }
- public function avatar_settings_field($args) {
- $options = get_option('simple_local_avatars_caps');
-?>
-
- ID;
- elseif (is_object($id_or_email) && !empty($id_or_email->user_id)) $user_id = (int)$id_or_email->user_id;
- if (empty($user_id)) return $avatar;
- $local_avatars = get_user_meta($user_id, 'simple_local_avatar', true);
- if (empty($local_avatars) || empty($local_avatars['full'])) return $avatar;
- $size = (int)$size;
- if (empty($alt)) $alt = get_the_author_meta('display_name', $user_id);
- if (empty($local_avatars[$size])) {
- $upload_path = wp_upload_dir();
- $avatar_full_path = str_replace($upload_path['baseurl'], $upload_path['basedir'], $local_avatars['full']);
- $image = wp_get_image_editor($avatar_full_path);
- if (!is_wp_error($image)) {
- $image->resize($size, $size, true);
- $image_sized = $image->save();
- }
- $local_avatars[$size] = is_wp_error($image_sized) ? $local_avatars[$size] = $local_avatars['full'] : str_replace($upload_path['basedir'], $upload_path['baseurl'], $image_sized['path']);
- update_user_meta($user_id, 'simple_local_avatar', $local_avatars);
- } elseif (substr($local_avatars[$size], 0, 4) != 'http') {
- $local_avatars[$size] = home_url($local_avatars[$size]);
- }
- $author_class = is_author($user_id) ? ' current-author' : '';
- $avatar = "
";
- return apply_filters('simple_local_avatar', $avatar);
- }
- public function edit_user_profile($profileuser) {
-?>
-
头像
-
-
- 'image/jpeg',
- 'gif' => 'image/gif',
- 'png' => 'image/png',
- );
- if (!function_exists('wp_handle_upload')) require_once ABSPATH . 'wp-admin/includes/file.php';
- $this->avatar_delete($user_id);
- if (strstr($_FILES['basic-user-avatar']['name'], '.php')) wp_die('基于安全考虑 ".php" 格式文件禁止上传');
- $this->user_id_being_edited = $user_id;
- $avatar = wp_handle_upload($_FILES['basic-user-avatar'], array(
- 'mimes' => $mimes,
- 'test_form' => false,
- 'unique_filename_callback' => array(
- $this,
- 'unique_filename_callback'
- )
- ));
- update_user_meta($user_id, 'simple_local_avatar', array(
- 'full' => $avatar['url']
- ));
- } elseif (!empty($_POST['basic-user-avatar-erase'])) {
- $this->avatar_delete($user_id);
- }
- }
- public function avatar_defaults($avatar_defaults) {
- remove_action('get_avatar', array(
- $this,
- 'get_avatar'
- ));
- return $avatar_defaults;
- }
- public function avatar_delete($user_id) {
- $old_avatars = get_user_meta($user_id, 'simple_local_avatar', true);
- $upload_path = wp_upload_dir();
- if (is_array($old_avatars)) {
- foreach ($old_avatars as $old_avatar) {
- $old_avatar_path = str_replace($upload_path['baseurl'], $upload_path['basedir'], $old_avatar);
- @unlink($old_avatar_path);
- }
- }
- delete_user_meta($user_id, 'simple_local_avatar');
- }
- public function unique_filename_callback($dir, $name, $ext) {
- $user = get_user_by('id', (int)$this->user_id_being_edited);
- $name = $base_name = sanitize_file_name($user->ID . '_avatar');
- $number = 1;
- while (file_exists($dir . "/$name$ext")) {
- $name = $base_name . '_' . $number;
- $number++;
- }
- return $name . $ext;
- }
-}
-$simple_local_avatars = new simple_local_avatars;
diff --git a/functions/func_load.php b/functions/func_load.php
index e15143c..06f206a 100644
--- a/functions/func_load.php
+++ b/functions/func_load.php
@@ -3,7 +3,7 @@
//require ( 'shortcode.php' );//短代码
include('optimization.php');//优化措施
-//require ( 'avatar.php' );//头像功能
+include( 'advanced.php' );//头像功能
//require ( 'server.php' );//第三方服务
diff --git a/functions/optimization.php b/functions/optimization.php
index 44dba74..a95ab15 100644
--- a/functions/optimization.php
+++ b/functions/optimization.php
@@ -3,9 +3,146 @@
//禁用新版编辑器
+if(gdk_get_option('gdk_diasble_gutenberg')){
add_filter('use_block_editor_for_post', '__return_false');
remove_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
-
+}
// 友情链接扩展
-add_filter('pre_option_link_manager_enabled', '__return_true');
\ No newline at end of file
+add_filter('pre_option_link_manager_enabled', '__return_true');
+
+//移除 WP_Head 无关紧要的代码
+if(gdk_get_option('gdk_diasble_head_useless')){
+ remove_action('wp_head', 'wp_generator'); //删除 head 中的 WP 版本号
+ foreach (array('rss2_head', 'commentsrss2_head', 'rss_head', 'rdf_header', 'atom_head', 'comments_atom_head', 'opml_head', 'app_head') as $action) {
+ remove_action($action, 'the_generator');
+ }
+
+ remove_action('wp_head', 'rsd_link'); //删除 head 中的 RSD LINK
+ remove_action('wp_head', 'wlwmanifest_link'); //删除 head 中的 Windows Live Writer 的适配器?
+
+ remove_action('wp_head', 'feed_links_extra', 3); //删除 head 中的 Feed 相关的link
+ //remove_action( 'wp_head', 'feed_links', 2 );
+
+ remove_action('wp_head', 'index_rel_link'); //删除 head 中首页,上级,开始,相连的日志链接
+ remove_action('wp_head', 'parent_post_rel_link', 10);
+ remove_action('wp_head', 'start_post_rel_link', 10);
+ remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);
+
+ remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); //删除 head 中的 shortlink
+
+ remove_action('wp_head', 'rest_output_link_wp_head', 10); // 删除头部输出 WP RSET API 地址
+
+ remove_action('template_redirect', 'wp_shortlink_header', 11); //禁止短链接 Header 标签。
+ remove_action('template_redirect', 'rest_output_link_header', 11); // 禁止输出 Header Link 标签。
+}
+
+
+/** 开始关闭WordPress更新 **/
+if (gdk_get_option('gdk_diasble_wp_update')) {
+ add_filter('automatic_updater_disabled', '__return_true');
+ remove_action('init', 'wp_schedule_update_checks');
+ wp_clear_scheduled_hook('wp_version_check');
+ wp_clear_scheduled_hook('wp_maybe_auto_update');
+ remove_action( 'admin_init', '_maybe_update_core' );
+ //禁用主题更新
+ wp_clear_scheduled_hook('wp_update_themes');
+ remove_action( 'load-themes.php', 'wp_update_themes' );
+ remove_action( 'load-update.php', 'wp_update_themes' );
+ remove_action( 'load-update-core.php', 'wp_update_themes' );
+ remove_action( 'admin_init', '_maybe_update_themes' );
+ // 禁用插件更新
+ wp_clear_scheduled_hook('wp_update_plugins');
+ remove_action( 'load-plugins.php', 'wp_update_plugins' );
+ remove_action( 'load-update.php', 'wp_update_plugins' );
+ remove_action( 'load-update-core.php', 'wp_update_plugins' );
+ remove_action( 'admin_init', '_maybe_update_plugins' );
+}
+
+//禁用自带p标签的
+remove_filter( 'the_content', 'wpautop' );
+add_filter( 'the_content', 'wpautop' , 12);
+
+//禁用emoji功能
+if (gdk_get_option('gdk_disable_emojis')) {
+ function gdk_disable_emojis_link() {
+ remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
+ remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
+ remove_action( 'wp_print_styles', 'print_emoji_styles' );
+ remove_action( 'admin_print_styles', 'print_emoji_styles' );
+ remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
+ remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
+ remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
+ add_filter( 'tiny_mce_plugins', 'gdk_disable_emojis_tinymce' );
+ }
+ add_action( 'init', 'gdk_disable_emojis_link' );
+
+ function gdk_disable_emojis_tinymce( $plugins ) {
+ if ( is_array( $plugins ) ) return array_diff( $plugins, array( 'wpemoji' ) );
+ return array();
+ }
+}
+
+
+//禁用 XML-RPC 接口
+if (gdk_get_option('gdk_disable_xmlrpc')) {
+ add_filter('xmlrpc_enabled', '__return_false');
+ remove_action('xmlrpc_rsd_apis', 'rest_output_rsd');
+}
+
+
+//禁用日志修订功能
+if (gdk_get_option('gdk_disable_revision')) {
+ function gdk_disable_post_revisions() {
+ foreach ( get_post_types() as $post_type ) {
+ remove_post_type_support( $post_type, 'revisions' );
+ }
+ }
+ add_action( 'init', 'gdk_disable_post_revisions', 999 );
+}
+
+//彻底关闭 pingback
+if (gdk_get_option('gdk_disable_trackbacks')) {
+ add_filter('xmlrpc_methods', 'gdk_xmlrpc_methods');
+ function gdk_xmlrpc_methods($methods) {
+ $methods['pingback.ping'] = '__return_false';
+ $methods['pingback.extensions.getPingbacks'] = '__return_false';
+ return $methods;
+ }
+ //禁用 pingbacks, enclosures, trackbacks
+ remove_action('do_pings', 'do_all_pings', 10);
+ //去掉 _encloseme 和 do_ping 操作。
+ remove_action('publish_post', '_publish_post_hook', 5);
+}
+
+//国内更新word press加速
+if (gdk_get_option('gdk_porxy_update') && !gdk_get_option('gdk_diasble_wp_update')) {
+ add_filter('site_transient_update_core',function($value) {
+ foreach($value->updates as &$update) {
+ if($update->locale == 'zh_CN') {
+ $update->download = 'http://cn.wp101.net/latest-zh_CN.zip';
+ $update->packages->full = 'http://cn.wp101.net/latest-zh_CN.zip';
+ }
+ }
+ return $value;
+ }
+ );
+}
+
+
+function html_page_permalink() {
+ global $wp_rewrite;
+ if (!strpos($wp_rewrite->get_page_permastruct(), '.html')) {
+ $wp_rewrite->page_structure = $wp_rewrite->page_structure . '.html';
+ }
+}
+add_action('init', 'html_page_permalink', -1);
+
+
+//中文文件重命名
+function gdk_upload_rename($file) {
+ $time = date("YmdHis");
+ $file['name'] = $time . "" . mt_rand(1, 100) . "." . pathinfo($file['name'], PATHINFO_EXTENSION);
+ return $file;
+}
+add_filter('wp_handle_upload_prefilter', 'gdk_upload_rename');
\ No newline at end of file
diff --git a/functions/utils.php b/functions/utils.php
index 608f328..b0ce41d 100644
--- a/functions/utils.php
+++ b/functions/utils.php
@@ -332,4 +332,54 @@ function nc_get_meta($key, $single = true) {
function nc_the_meta($key, $placeholder = '') {
echo nc_get_meta($key, true) ?: $placeholder;
+}
+
+function gdk_is_mobile() {
+ if (empty($_SERVER['HTTP_USER_AGENT'])) {
+ return false;
+ } elseif ((strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') === false) // many mobile devices (all iPh, etc.)
+ || strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'NetType/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Kindle') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'MQQBrowser') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mobi') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'HUAWEI') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'TBS/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Mi') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+if (function_exists('curl_init')) {
+ function curl_post($url, $postfields = '', $headers = '', $timeout = 20, $file = 0) {
+ $ch = curl_init();
+ $options = array(
+ CURLOPT_URL => $url,
+ CURLOPT_HEADER => false,
+ CURLOPT_NOBODY => false,
+ CURLOPT_POST => true,
+ CURLOPT_MAXREDIRS => 20,
+ CURLOPT_USERAGENT => 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36',
+ CURLOPT_TIMEOUT => $timeout,
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_FOLLOWLOCATION => true,
+ CURLOPT_SSL_VERIFYHOST => 0,
+ CURLOPT_SSL_VERIFYPEER => 0
+ );
+ if (is_array($postfields) && $file == 0) {
+ $options[CURLOPT_POSTFIELDS] = http_build_query($postfields);
+ } else {
+ $options[CURLOPT_POSTFIELDS] = $postfields;
+ }
+ curl_setopt_array($ch, $options);
+ if (is_array($headers)) {
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+ }
+ $result = curl_exec($ch);
+ $code = curl_errno($ch);
+ $msg = curl_error($ch);
+ $info = curl_getinfo($ch);
+ curl_close($ch);
+ return array(
+ 'data' => $result,
+ 'code' => $code,
+ 'msg' => $msg,
+ 'info' => $info
+ );
+ }
}
\ No newline at end of file
diff --git a/modules/base/functions/rocket.php b/modules/base/functions/rocket.php
index cb5e4ef..e39dd55 100644
--- a/modules/base/functions/rocket.php
+++ b/modules/base/functions/rocket.php
@@ -20,81 +20,16 @@ if (!function_exists('nc_admin_logo')):
add_action('login_head', 'nc_admin_logo');
endif;
-//移除 WP_Head 无关紧要的代码
-if ($general_options['remove_wp_head_useless']) {
- remove_action('wp_head', 'wp_generator'); //删除 head 中的 WP 版本号
- foreach (array('rss2_head', 'commentsrss2_head', 'rss_head', 'rdf_header', 'atom_head', 'comments_atom_head', 'opml_head', 'app_head') as $action) {
- remove_action($action, 'the_generator');
- }
-
- remove_action('wp_head', 'rsd_link'); //删除 head 中的 RSD LINK
- remove_action('wp_head', 'wlwmanifest_link'); //删除 head 中的 Windows Live Writer 的适配器?
-
- remove_action('wp_head', 'feed_links_extra', 3); //删除 head 中的 Feed 相关的link
- //remove_action( 'wp_head', 'feed_links', 2 );
-
- remove_action('wp_head', 'index_rel_link'); //删除 head 中首页,上级,开始,相连的日志链接
- remove_action('wp_head', 'parent_post_rel_link', 10);
- remove_action('wp_head', 'start_post_rel_link', 10);
- remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);
-
- remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); //删除 head 中的 shortlink
-
- remove_action('wp_head', 'rest_output_link_wp_head', 10); // 删除头部输出 WP RSET API 地址
-
- remove_action('template_redirect', 'wp_shortlink_header', 11); //禁止短链接 Header 标签。
- remove_action('template_redirect', 'rest_output_link_header', 11); // 禁止输出 Header Link 标签。
-}
-
-//禁用日志修订功能
-if ($general_options['post_revision']) {
- if (!function_exists('nc_disable_post_revisions')):
- function nc_disable_post_revisions() {
- foreach ( get_post_types() as $post_type ) {
- remove_post_type_support( $post_type, 'revisions' );
- }
- }
- add_action( 'init', 'nc_disable_post_revisions', 999 );
- endif;
-}
-
-if (isset($general_options['core_update']) && $general_options['core_update']) {
- add_filter('site_transient_update_core', 'nc_core_update_cdn');
- function nc_core_update_cdn($value) {
- foreach ($value->updates as &$update) {
- $update->download = str_replace('downloads.wordpress.org', 'downloads.wordpress.org.nicetheme.xyz', $update->download);
- $update->packages->full = str_replace('downloads.wordpress.org', 'downloads.wordpress.org.nicetheme.xyz', $update->packages->full);
- }
-
- return $value;
- }
-}
-
-if ($general_options['disable_trackbacks']) {
- //彻底关闭 pingback
- if (!function_exists('nc_xmlrpc_methods')):
- add_filter('xmlrpc_methods', 'nc_xmlrpc_methods');
- function nc_xmlrpc_methods($methods)
- {
- $methods['pingback.ping'] = '__return_false';
- $methods['pingback.extensions.getPingbacks'] = '__return_false';
-
- return $methods;
- }
- endif;
- //禁用 pingbacks, enclosures, trackbacks
- remove_action('do_pings', 'do_all_pings', 10);
-
- //去掉 _encloseme 和 do_ping 操作。
- remove_action('publish_post', '_publish_post_hook', 5);
-}
-//禁用 XML-RPC 接口
-if ($general_options['disable_xmlrpc']) {
- add_filter('xmlrpc_enabled', '__return_false');
- remove_action('xmlrpc_rsd_apis', 'rest_output_rsd');
-}
+
+
+
+
+
+
+
+
//禁用 Auto OEmbed
// if ($general_options['disable_auto_embeds']) {
@@ -139,81 +74,5 @@ if ($general_options['gravatar_speedup']) {
endif;
}
-if ($general_options['disable_emoji']) {
- if (!function_exists('nc_disable_emojis')):
- function nc_disable_emojis() {
- remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
- remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
- remove_action( 'wp_print_styles', 'print_emoji_styles' );
- remove_action( 'admin_print_styles', 'print_emoji_styles' );
- remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
- remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
- remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
- add_filter( 'tiny_mce_plugins', 'nc_disable_emojis_tinymce' );
- }
- add_action( 'init', 'nc_disable_emojis' );
- endif;
- if (!function_exists('nc_disable_emojis_tinymce')):
- function nc_disable_emojis_tinymce( $plugins ) {
- if ( is_array( $plugins ) ) return array_diff( $plugins, array( 'wpemoji' ) );
- return array();
- }
- endif;
-}
-if ($general_options['emoji_cdn']) {
- if (!function_exists('nc_change_wp_emoji_baseurl')):
- function nc_change_wp_emoji_baseurl() {
- return set_url_scheme('//twemoji.maxcdn.com/2/72x72/');
- }
- add_action( 'emoji_url', 'nc_change_wp_emoji_baseurl' );
- endif;
- if (!function_exists('nc_change_wp_emoji_baseurl')):
- function nc_change_wp_emoji_svgurl($url) {
- return set_url_scheme('//twemoji.maxcdn.com/svg/');
- }
- add_filter('emoji_svg_url', 'nc_change_wp_emoji_svgurl');
- endif;
-}
-if ($general_options['disable_wp_widgets']) {
- if (!function_exists('nc_unregister_rss_widget')):
- function nc_unregister_rss_widget(){
- unregister_widget('WP_Widget_Pages');
- unregister_widget('WP_Nav_Menu_Widget');
- unregister_widget('WP_Widget_Categories');
- unregister_widget('WP_Widget_Meta');
- unregister_widget('WP_Widget_RSS');
- unregister_widget('WP_Widget_Calendar');
- unregister_widget('WP_Widget_Links');
- unregister_widget('WP_Widget_Recent_Comments');
- }
- add_action('widgets_init', 'nc_unregister_rss_widget');
- endif;
-}
-
-if ($general_options['disable_core_update']) {
- add_filter('automatic_updater_disabled', '__return_true');
-
- remove_action('init', 'wp_schedule_update_checks');
- wp_clear_scheduled_hook('wp_version_check');
- wp_clear_scheduled_hook('wp_maybe_auto_update');
-
- remove_action( 'admin_init', '_maybe_update_core' );
-}
-
-if ($general_options['disable_theme_update']) {
- wp_clear_scheduled_hook('wp_update_themes');
- remove_action( 'load-themes.php', 'wp_update_themes' );
- remove_action( 'load-update.php', 'wp_update_themes' );
- remove_action( 'load-update-core.php', 'wp_update_themes' );
- remove_action( 'admin_init', '_maybe_update_themes' );
-}
-
-if ($general_options['disable_plugin_update']) {
- wp_clear_scheduled_hook('wp_update_plugins');
- remove_action( 'load-plugins.php', 'wp_update_plugins' );
- remove_action( 'load-update.php', 'wp_update_plugins' );
- remove_action( 'load-update-core.php', 'wp_update_plugins' );
- remove_action( 'admin_init', '_maybe_update_plugins' );
-}
\ No newline at end of file
diff --git a/route.php b/route.php
index 3384efd..a95f4c9 100644
--- a/route.php
+++ b/route.php
@@ -26,20 +26,20 @@ define('NC_STORE_VER', '0.3.5');
define('NC_STORE_FILE', __FILE__);//插件入口文件
define('NC_BASE_URL', plugin_dir_url( __FILE__ ) );//插件目录url
define('NC_STORE_ROOT_PATH', plugin_dir_path( __FILE__ ) );//插件目录路径
-include('library/nc-base/kernel/kernel.php');
-include('library/nc-base/static-load.php');
-include('library/nc-base/add-menu-page.php');
+//include('library/nc-base/kernel/kernel.php');
+//include('library/nc-base/static-load.php');
+//include('library/nc-base/add-menu-page.php');
if (version_compare(PHP_VERSION, '7.2.26', '>=')) {
- include('modules/field-group/Field_Group_Values.php');
- include('modules/field-group/get_all_custom_field_meta.php');
+ //include('modules/field-group/Field_Group_Values.php');
+ //include('modules/field-group/get_all_custom_field_meta.php');
}
-include('modules/base/main.php');
-
+//include('modules/base/main.php');
+include('framework/plugin-options.php');
include('functions/func_load.php');
-include('framework/load.php');
+
function nc_store_pluggable_include() {
include( 'modules/pluggable/load.php' );