From ac853b8a3c80ab7885629d50e91518548cba3041 Mon Sep 17 00:00:00 2001 From: jianbo <20397795@qq.com> Date: Sat, 27 Feb 2021 23:01:09 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8A=A0=E5=85=A5=E6=8F=92=E5=B1=8F?= =?UTF-8?q?=E5=B9=BF=E5=91=8A=E5=90=AF=E7=94=A8=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=202=E3=80=81=E4=BF=AE=E5=A4=8D=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=AE=89=E5=85=A8=E6=A3=80=E6=B5=8B=E7=9A=84bug=203?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E5=A4=8D=E4=B8=8E=E5=8F=A4=E8=85=BE=E5=A0=A1?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/ram-rest-categories-controller.php | 7 +- includes/api/ram-rest-live-controller.php | 9 +- includes/api/ram-rest-settings-controller.php | 23 +++++ includes/filter/ram-custom-post-fields.php | 6 +- includes/ram-weixin-api.php | 11 +++ includes/settings/wp-wechat-config.php | 91 ++++++++++++++++--- 6 files changed, 129 insertions(+), 18 deletions(-) diff --git a/includes/api/ram-rest-categories-controller.php b/includes/api/ram-rest-categories-controller.php index 17ca4e4..55ceac4 100644 --- a/includes/api/ram-rest-categories-controller.php +++ b/includes/api/ram-rest-categories-controller.php @@ -56,7 +56,7 @@ class RAM_REST_Categories_Controller extends WP_REST_Controller{ array( 'methods' => 'GET', 'callback' => array( $this, 'get_categories_ids' ), - //'permission_callback' => array( $this, 'get_item_permissions_check' ) + 'permission_callback' => array( $this, 'get_categories_ids_permissions_check' ) ), // Register our schema callback. @@ -248,5 +248,10 @@ class RAM_REST_Categories_Controller extends WP_REST_Controller{ return true; } + public function get_categories_ids_permissions_check($request ) + { + return true; + } + } diff --git a/includes/api/ram-rest-live-controller.php b/includes/api/ram-rest-live-controller.php index 4209fe3..b8f3772 100644 --- a/includes/api/ram-rest-live-controller.php +++ b/includes/api/ram-rest-live-controller.php @@ -40,8 +40,8 @@ class RAM_REST_Live_Controller extends WP_REST_Controller{ // Here we register the readable endpoint for collections. array( 'methods' => 'GET', - 'callback' => array( $this, 'getliveinfo' ) - // 'permission_callback' => array( $this, 'get_pages_about_permissions_check' ) + 'callback' => array( $this, 'getliveinfo' ), + 'permission_callback' => array( $this, 'getliveinfo_permissions_check' ) ), // Register our schema callback. @@ -141,4 +141,9 @@ class RAM_REST_Live_Controller extends WP_REST_Controller{ } return true; } + + public function getliveinfo_permissions_check($request) + { + return true; + } } diff --git a/includes/api/ram-rest-settings-controller.php b/includes/api/ram-rest-settings-controller.php index fdf9f2b..a48dc67 100644 --- a/includes/api/ram-rest-settings-controller.php +++ b/includes/api/ram-rest-settings-controller.php @@ -81,6 +81,29 @@ class RAM_REST_Options_Controller extends WP_REST_Controller{ $interstitialAdId =empty(get_option('wf_interstitial_ad_id'))?"":get_option('wf_interstitial_ad_id'); $wf_enterprise_minapp =empty(get_option('wf_enterprise_minapp'))?"0":get_option('wf_enterprise_minapp'); + $enable_index_interstitial_ad =empty(get_option('enable_index_interstitial_ad'))?"0":get_option('enable_index_interstitial_ad'); + $enable_detail_interstitial_ad =empty(get_option('enable_detail_interstitial_ad'))?"0":get_option('enable_detail_interstitial_ad'); + $enable_topic_interstitial_ad =empty(get_option('enable_topic_interstitial_ad'))?"0":get_option('enable_topic_interstitial_ad'); + $enable_list_interstitial_ad =empty(get_option('enable_list_interstitial_ad'))?"0":get_option('enable_list_interstitial_ad'); + $enable_hot_interstitial_ad =empty(get_option('enable_hot_interstitial_ad'))?"0":get_option('enable_hot_interstitial_ad'); + $enable_comments_interstitial_ad =empty(get_option('enable_comments_interstitial_ad'))?"0":get_option('enable_comments_interstitial_ad'); + $enable_live_interstitial_ad =empty(get_option('enable_live_interstitial_ad'))?"0":get_option('enable_comments_interstitial_ad'); + + + $result["enable_index_interstitial_ad"]=$enable_index_interstitial_ad; + $result["enable_detail_interstitial_ad"]=$enable_detail_interstitial_ad; + $result["enable_topic_interstitial_ad"]=$enable_topic_interstitial_ad; + $result["enable_list_interstitial_ad"]=$enable_list_interstitial_ad; + $result["enable_hot_interstitial_ad"]=$enable_hot_interstitial_ad; + $result["enable_comments_interstitial_ad"]=$enable_comments_interstitial_ad; + $result["enable_live_interstitial_ad"]=$enable_live_interstitial_ad; + + + + + + + $result["wf_enable_comment_option"]=$wf_enable_comment_option; $result["interstitialAdId"]=$interstitialAdId; $result["wf_enterprise_minapp"]=$wf_enterprise_minapp; diff --git a/includes/filter/ram-custom-post-fields.php b/includes/filter/ram-custom-post-fields.php index 4701ae5..acc961a 100644 --- a/includes/filter/ram-custom-post-fields.php +++ b/includes/filter/ram-custom-post-fields.php @@ -8,9 +8,9 @@ function custom_post_fields( $data, $post, $request) { $post_id =$post->ID; //去除 _links - foreach($data->get_links() as $_linkKey => $_linkVal) { - $data->remove_link($_linkKey); - } +// foreach($data->get_links() as $_linkKey => $_linkVal) { +// $data->remove_link($_linkKey); +// } //$content =get_the_content(); $content=$_data['content']['rendered']; diff --git a/includes/ram-weixin-api.php b/includes/ram-weixin-api.php index 6126a7b..3d9787e 100644 --- a/includes/ram-weixin-api.php +++ b/includes/ram-weixin-api.php @@ -53,6 +53,17 @@ class RAM_Weixin_API { // 发起API请求 private function request( $url, $method, $body ) { + if(strpos($url,'msg_sec_check') !==false) + { + //内容安全检测不进行unicode转码 + $body =json_encode( $body,JSON_UNESCAPED_UNICODE); + + } + else + { + $body =json_encode( $body ); + + } $response = wp_remote_request( $url, array( 'method' => $method, 'body' => json_encode( $body ) diff --git a/includes/settings/wp-wechat-config.php b/includes/settings/wp-wechat-config.php index 35d97f0..2d95964 100644 --- a/includes/settings/wp-wechat-config.php +++ b/includes/settings/wp-wechat-config.php @@ -63,6 +63,21 @@ function register_weixinappsettings() { register_setting( 'weixinapp-group', 'wf_zan_imageurl' ); register_setting( 'weixinapp-group', 'wf_logo_imageurl' ); + register_setting( 'weixinapp-group', 'enable_index_interstitial_ad' ); + register_setting( 'weixinapp-group', 'enable_detail_interstitial_ad' ); + register_setting( 'weixinapp-group', 'enable_topic_interstitial_ad' ); + register_setting( 'weixinapp-group', 'enable_list_interstitial_ad' ); + register_setting( 'weixinapp-group', 'enable_hot_interstitial_ad' ); + register_setting( 'weixinapp-group', 'enable_comments_interstitial_ad' ); + register_setting( 'weixinapp-group', 'enable_live_interstitial_ad' ); + + + + + + + + @@ -198,7 +213,17 @@ if (version_compare(PHP_VERSION, '5.6.0', '<=') ) ?> - + + + + 小程序是否是企业主体 + + '; + ?>

* 如果是企业主体的小程序,请勾选

+ 小程序logo图片地址 @@ -237,15 +262,7 @@ if (version_compare(PHP_VERSION, '5.6.0', '<=') )

请输入域名,用英文逗号分隔。仅支持企业主体小程序。

- - 小程序是否是企业主体 - - '; - ?>

* 如果是企业主体的小程序,请勾选

- + @@ -292,11 +309,61 @@ if (version_compare(PHP_VERSION, '5.6.0', '<=') ) + 插屏广告id - - + + + + 启动插屏广告的页面 + + '; + ?> +   + '; + ?> + +   + '; + ?> +   + '; + ?> +   + '; + ?> +   + '; + ?> +   + '; + ?> + + + + -- GitLab