From 011964ba43956fae55b894d89e3ca8641390fce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E8=90=BD?= Date: Wed, 29 Jan 2020 14:46:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E4=B8=8D?= =?UTF-8?q?=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/Payjs.php | 2 +- framework/options-config.php | 2 +- functions/Common.php | 2 +- functions/advanced.php | 8 ++++---- functions/func_load.php | 2 +- functions/optimization.php | 28 ++++++++++++++-------------- functions/security.php | 2 +- functions/seo.php | 12 ++++++------ gdk_route.php | 2 +- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/class/Payjs.php b/class/Payjs.php index f2e86c8..5a91498 100644 --- a/class/Payjs.php +++ b/class/Payjs.php @@ -1,6 +1,6 @@ 'CDN水印', 'desc' => '启用【如果启用,请在七牛,又拍,OSS等CDN中设置自定义样式,名字为:water.jpg,分隔符为! 】', - 'id' => 'git_cdn_water', + 'id' => 'gdk_cdn_water', 'type' => 'checkbox' ], [ diff --git a/functions/Common.php b/functions/Common.php index 314499b..c733cc2 100644 --- a/functions/Common.php +++ b/functions/Common.php @@ -347,7 +347,7 @@ function gdk_is_mobile() { } if (function_exists('curl_init')) { - function curl_post($url, $postfields = '', $headers = '', $timeout = 20, $file = 0) { + function gdk_curl($url, $postfields = '', $headers = '', $timeout = 20, $file = 0) { $ch = curl_init(); $options = array( CURLOPT_URL => $url, diff --git a/functions/advanced.php b/functions/advanced.php index 8d0729d..ffbef36 100644 --- a/functions/advanced.php +++ b/functions/advanced.php @@ -4,7 +4,7 @@ if (gdk_option('gdk_cdn')) add_action('wp_loaded', 'gdk_cdn_sta if (gdk_option('gdk_link_go')) add_filter('the_content','gdk_link_go',999);// 外链GO跳转 if (gdk_option('gdk_smtp')) add_action('phpmailer_init', 'gdk_smtp');//SMTP -if (gdk_option('git_cdn_water')) add_filter('the_content', 'cdn_water');//CDN水印 +if (gdk_option('gdk_cdn_water')) add_filter('the_content', 'gdk_cdn_water');//CDN水印 @@ -37,13 +37,13 @@ add_filter('get_avatar', 'gdk_switch_get_avatar'); //fancybox图片灯箱效果 -function fancybox($content) { +function gdk_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'); +add_filter('the_content', 'gdk_fancybox'); function gdk_link_go($content) { @@ -99,7 +99,7 @@ function gdk_cdn_replace($html) { //CDN水印 -function cdn_water($content) { +function gdk_cdn_water($content) { if (get_post_type() == 'post') { $pattern = "//i"; $replacement = ''; diff --git a/functions/func_load.php b/functions/func_load.php index be054c4..54c9206 100644 --- a/functions/func_load.php +++ b/functions/func_load.php @@ -9,6 +9,6 @@ include( 'security.php' );//安全功能 -include( 'shortcode.php' );//短代码 +//include( 'shortcode.php' );//短代码 include( 'seo.php' );//seo功能 diff --git a/functions/optimization.php b/functions/optimization.php index 8d56f42..67a62e5 100644 --- a/functions/optimization.php +++ b/functions/optimization.php @@ -20,24 +20,24 @@ remove_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' ); add_filter('user_can_richedit','__return_false'); //禁用响应式图片 -function msiw(){ +function gdk_disable_srcset_img(){ return 1; } -add_filter('max_srcset_image_width', 'msiw'); +add_filter('max_srcset_image_width', 'gdk_disable_srcset_img'); //移除默认的图片宽度以及高度 -function remove_wps_width($html) { +function gdk_remove_img_width($html) { $html = preg_replace('/(width|height)=\"\d*\"\s/', "", $html); return $html; } -add_filter('post_thumbnail_html', 'remove_wps_width', 10); -add_filter('image_send_to_editor', 'remove_wps_width', 10); +add_filter('post_thumbnail_html', 'gdk_remove_img_width', 10); +add_filter('image_send_to_editor', 'gdk_remove_img_width', 10); //取消后台登陆错误的抖动提示 -function git_wps_login_error() { +function gdk_wps_login_error() { remove_action('login_head', 'wp_shake_js', 12); } -add_action('login_head', 'git_wps_login_error'); +add_action('login_head', 'gdk_wps_login_error'); // 友情链接扩展 @@ -113,28 +113,28 @@ function remove_dns_prefetch( $hints, $relation_type ) { add_filter( 'wp_resource_hints', 'remove_dns_prefetch', 10, 2 ); //强制阻止WordPress代码转义 -function git_esc_html($content) { +function gdk_esc_html($content) { $regex = '/(]*?class\s*?=\s*?[",\'].*?prettyprint.*?[",\'].*?>)(.*?)(<\/pre>)/sim'; - return preg_replace_callback($regex, 'git_esc_callback', $content); + return preg_replace_callback($regex, 'gdk_esc_callback', $content); } -function git_esc_callback($matches) { +function gdk_esc_callback($matches) { $tag_open = $matches[1]; $content = $matches[2]; $tag_close = $matches[3]; $content = esc_html($content); return $tag_open . $content . $tag_close; } -add_filter('the_content', 'git_esc_html', 2); -add_filter('comment_text', 'git_esc_html', 2); +add_filter('the_content', 'gdk_esc_html', 2); +add_filter('comment_text', 'gdk_esc_html', 2); //强制兼容
-function git_prettify_replace($text) {
+function gdk_prettify_replace($text) {
     $replace = array(
         '
' => '
'
     );
     $text = str_replace(array_keys($replace) , $replace, $text);
     return $text;
 }
-add_filter('the_content', 'git_prettify_replace');
+add_filter('the_content', 'gdk_prettify_replace');
 
 
 
diff --git a/functions/security.php b/functions/security.php
index df0c9df..1c1bdee 100644
--- a/functions/security.php
+++ b/functions/security.php
@@ -1,6 +1,6 @@
 \n";
 }
 
-    add_action('wp_head', 'deel_description');
+    add_action('wp_head', 'gdk_deel_description');
 
 
 
@@ -401,7 +401,7 @@ function deel_description() {
 
 
 //评论分页的seo处理
-function canonical_for_git(){
+function gdk_canonical(){
     global $post;
     if (get_query_var('paged') > 1) {
         echo "\n";
@@ -411,4 +411,4 @@ function canonical_for_git(){
         echo "";
     }
 }
-add_action('wp_head', 'canonical_for_git');
\ No newline at end of file
+add_action('wp_head', 'gdk_canonical');
\ No newline at end of file
diff --git a/gdk_route.php b/gdk_route.php
index 99e0b11..58a25ca 100644
--- a/gdk_route.php
+++ b/gdk_route.php
@@ -27,6 +27,6 @@ define('GDK_ROOT_PATH', plugin_dir_path( __FILE__ ) );//插件目录路径
 
 //加载各种资源
 include('class/class_load.php');//加载各种类
-include('framework/frame_load');//加载后台框架
+include('framework/frame_load.php');//加载后台框架
 include('functions/func_load.php');//加载函数
 include('assets/assets_load.php');//加载静态资源