提交 ac853b8a 编写于 作者: J jianbo

1、加入插屏广告启用页面的配置

2、修复内容安全检测的bug
3、修复与古腾堡编辑器的兼容性问题
上级 528bb239
......@@ -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;
}
}
......@@ -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;
}
}
......@@ -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;
......
......@@ -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'];
......
......@@ -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 )
......
......@@ -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', '<=') )
?>
</td>
</tr>
</tr>
<tr valign="top">
<th scope="row">小程序是否是企业主体</th>
<td>
<?php
$wf_enterprise_minapp =get_option('wf_enterprise_minapp');
$checkbox=empty($wf_enterprise_minapp)?'':'checked';
echo '<input name="wf_enterprise_minapp" type="checkbox" value="1" '.$checkbox. ' />';
?><p style="color: #959595; display:inline">* 如果是企业主体的小程序,请勾选</p>
</td>
<tr valign="top">
<th scope="row">小程序logo图片地址</th>
......@@ -237,15 +262,7 @@ if (version_compare(PHP_VERSION, '5.6.0', '<=') )
<br/><p style="color: #959595; display:inline">请输入域名,用英文逗号分隔。仅支持企业主体小程序。</p></td>
<tr valign="top">
<th scope="row">小程序是否是企业主体</th>
<td>
<?php
$wf_enterprise_minapp =get_option('wf_enterprise_minapp');
$checkbox=empty($wf_enterprise_minapp)?'':'checked';
echo '<input name="wf_enterprise_minapp" type="checkbox" value="1" '.$checkbox. ' />';
?><p style="color: #959595; display:inline">* 如果是企业主体的小程序,请勾选</p>
</td>
</tr>
</table>
......@@ -292,11 +309,61 @@ if (version_compare(PHP_VERSION, '5.6.0', '<=') )
<input type="text" name="wf_video_ad_id" style="width:300px; height:40px" value="<?php echo esc_attr( get_option('wf_video_ad_id') ); ?>" />
</td>
</tr>
<tr valign="top">
<th scope="row">插屏广告id</th>
<td>
<input type="text" name="wf_interstitial_ad_id" style="width:300px; height:40px" value="<?php echo esc_attr( get_option('wf_interstitial_ad_id') ); ?>" />
</td>
</tr>
</td>
</tr>
<tr valign="top">
<th scope="row">启动插屏广告的页面</th>
<td>
<?php
$enable_index_interstitial_ad =get_option('enable_index_interstitial_ad');
$checkbox=empty($enable_index_interstitial_ad)?'':'checked';
echo '首页<input name="enable_index_interstitial_ad" type="checkbox" value="1" '.$checkbox. ' />';
?>
&emsp;
<?php
$enable_detail_interstitial_ad =get_option('enable_detail_interstitial_ad');
$checkbox=empty($enable_detail_interstitial_ad)?'':'checked';
echo '文章详情页<input name="enable_detail_interstitial_ad" type="checkbox" value="1" '.$checkbox. ' />';
?>
&emsp;
<?php
$enable_topic_interstitial_ad =get_option('enable_topic_interstitial_ad');
$checkbox=empty($enable_topic_interstitial_ad)?'':'checked';
echo '专题(分类)页<input name="enable_topic_interstitial_ad" type="checkbox" value="1" '.$checkbox. ' />';
?>
&emsp;
<?php
$enable_list_interstitial_ad =get_option('enable_list_interstitial_ad');
$checkbox=empty($enable_list_interstitial_ad)?'':'checked';
echo '专题(分类)文章列表页 &emsp;<input name="enable_list_interstitial_ad" type="checkbox" value="1" '.$checkbox. ' />';
?>
&emsp;
<?php
$enable_hot_interstitial_ad =get_option('enable_hot_interstitial_ad');
$checkbox=empty($enable_hot_interstitial_ad)?'':'checked';
echo '排行页<input name="enable_hot_interstitial_ad" type="checkbox" value="1" '.$checkbox. ' />';
?>
&emsp;
<?php
$enable_comments_interstitial_ad =get_option('enable_comments_interstitial_ad');
$checkbox=empty($enable_comments_interstitial_ad)?'':'checked';
echo '最新评论页<input name="enable_comments_interstitial_ad" type="checkbox" value="1" '.$checkbox. ' />';
?>
&emsp;
<?php
$enable_live_interstitial_ad =get_option('enable_live_interstitial_ad');
$checkbox=empty($enable_live_interstitial_ad)?'':'checked';
echo '直播页<input name="enable_live_interstitial_ad" type="checkbox" value="1" '.$checkbox. ' />';
?>
</td>
</tr>
</table>
</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册