Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ijianbo
rest Api To Miniprogram
提交
ac853b8a
rest Api To Miniprogram
项目概览
ijianbo
/
rest Api To Miniprogram
通知
22
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
rest Api To Miniprogram
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ac853b8a
编写于
2月 27, 2021
作者:
J
jianbo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、加入插屏广告启用页面的配置
2、修复内容安全检测的bug 3、修复与古腾堡编辑器的兼容性问题
上级
528bb239
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
129 addition
and
18 deletion
+129
-18
includes/api/ram-rest-categories-controller.php
includes/api/ram-rest-categories-controller.php
+6
-1
includes/api/ram-rest-live-controller.php
includes/api/ram-rest-live-controller.php
+7
-2
includes/api/ram-rest-settings-controller.php
includes/api/ram-rest-settings-controller.php
+23
-0
includes/filter/ram-custom-post-fields.php
includes/filter/ram-custom-post-fields.php
+3
-3
includes/ram-weixin-api.php
includes/ram-weixin-api.php
+11
-0
includes/settings/wp-wechat-config.php
includes/settings/wp-wechat-config.php
+79
-12
未找到文件。
includes/api/ram-rest-categories-controller.php
浏览文件 @
ac853b8a
...
...
@@ -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
;
}
}
includes/api/ram-rest-live-controller.php
浏览文件 @
ac853b8a
...
...
@@ -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
;
}
}
includes/api/ram-rest-settings-controller.php
浏览文件 @
ac853b8a
...
...
@@ -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
;
...
...
includes/filter/ram-custom-post-fields.php
浏览文件 @
ac853b8a
...
...
@@ -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'
];
...
...
includes/ram-weixin-api.php
浏览文件 @
ac853b8a
...
...
@@ -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
)
...
...
includes/settings/wp-wechat-config.php
浏览文件 @
ac853b8a
...
...
@@ -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
.
' />'
;
?>
 
<?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
.
' />'
;
?>
 
<?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
.
' />'
;
?>
 
<?php
$enable_list_interstitial_ad
=
get_option
(
'enable_list_interstitial_ad'
);
$checkbox
=
empty
(
$enable_list_interstitial_ad
)
?
''
:
'checked'
;
echo
'专题(分类)文章列表页  <input name="enable_list_interstitial_ad" type="checkbox" value="1" '
.
$checkbox
.
' />'
;
?>
 
<?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
.
' />'
;
?>
 
<?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
.
' />'
;
?>
 
<?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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录