From 4ef40dd3ac054e23b86ce4ff025a01dfc0753fc8 Mon Sep 17 00:00:00 2001 From: jianbo <20397795@qq.com> Date: Thu, 7 Nov 2019 13:57:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=BE=AE=E4=BF=A1=E5=B9=BF?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/filter/ram-custom-post-fields.php | 24 +++++++++-- includes/settings/wp-wechat-config.php | 47 ++++++++++++++++++++-- rest-api-to-miniprogram.php | 8 +++- 3 files changed, 71 insertions(+), 8 deletions(-) diff --git a/includes/filter/ram-custom-post-fields.php b/includes/filter/ram-custom-post-fields.php index 285f33f..8986467 100644 --- a/includes/filter/ram-custom-post-fields.php +++ b/includes/filter/ram-custom-post-fields.php @@ -67,12 +67,18 @@ function custom_post_fields( $data, $post, $request) { //获取广告参数 $detailAdId=empty(get_option('wf_detail_ad_id'))?'':get_option('wf_detail_ad_id'); $detailAd=empty(get_option('wf_detail_ad'))?'0':"1"; - + + $rewardedVideoAdId=empty(get_option('wf_excitation_ad_id'))?'':get_option('wf_excitation_ad_id'); + $excitationAd = empty(get_post_meta($post_id, '_excitation', true))?"0":get_post_meta($post_id, '_excitation', true); + + $_data['excitationAd']=$excitationAd; + $_data['rewardedVideoAdId']=$rewardedVideoAdId; + $_data['detailAdId']=$detailAdId; $_data['detailAd']=$detailAd; $enterpriseMinapp=get_option('wf_enterprise_minapp'); - $praiseWord=empty($enterpriseMinapp)?'0':$enterpriseMinapp; + $enterpriseMinapp=empty($enterpriseMinapp)?'0':$enterpriseMinapp; $_data['enterpriseMinapp']=$enterpriseMinapp; @@ -122,8 +128,18 @@ function custom_post_fields( $data, $post, $request) { $avatar= get_user_meta( $userId, 'avatar', true ); } - $_avatarurl['avatarurl'] =$avatar; - $avatarurls[] = $_avatarurl; + if(!empty($avatar)) + { + $_avatarurl['avatarurl'] =$avatar; + + + } + else{ + $avatar = plugins_url()."/".REST_API_TO_MINIPROGRAM_PLUGIN_NAME."/includes/images/gravatar.png"; + $_avatarurl['avatarurl'] =$avatar; + } + $avatarurls[] = $_avatarurl; + } $post_views =$post_views+1; if(!update_post_meta($post_id, 'wl_pageviews', $post_views)) diff --git a/includes/settings/wp-wechat-config.php b/includes/settings/wp-wechat-config.php index 5e2254a..722c6b0 100644 --- a/includes/settings/wp-wechat-config.php +++ b/includes/settings/wp-wechat-config.php @@ -39,8 +39,17 @@ function register_weixinappsettings() { register_setting( 'weixinapp-group', 'wf_list_ad_every' ); + + register_setting( 'weixinapp-group', 'wf_excitation_ad_id' ); + + + register_setting( 'weixinapp-group', 'wf_detail_ad' ); register_setting( 'weixinapp-group', 'wf_detail_ad_id' ); + register_setting( 'weixinapp-group', 'wf_about' ); + register_setting( 'weixinapp-group', 'wf_display_categories' ); + + @@ -123,6 +132,31 @@ if (version_compare(PHP_VERSION, '5.6.0', '<=') )

* 请用英文半角逗号分隔

+ + 在小程序里显示的文章分类id + +

* 文章分类id,只支持一级分类,请用英文半角逗号分隔,留空则显示所有分类

+ + + + + 选择"关于"页面 + + + + + 开启小程序的评论 @@ -198,6 +232,13 @@ if (version_compare(PHP_VERSION, '5.6.0', '<=') )    广告id:  + + + 激励视频广告id + + + + @@ -207,7 +248,7 @@ if (version_compare(PHP_VERSION, '5.6.0', '<=') )
微慕官网
微慕商城
-

微慕Plus小程序是一款,在原守望轩开源小程序(现微慕开源小程序)基础上重新架构、设计、优化过的wordpress多端小程序,性能和用户体验更佳,界面设计更加简洁清新,同时打通微信小程序、QQ小程序、百度小程序、支付宝小程序、头条小程序...真正实现一站多端,可使用微信扫描下方小程序码直接体验:

+

微慕增强版WordPress小程序是一款,在原守望轩开源小程序(现微慕开源小程序)基础上重新架构、设计、优化过的wordpress多端小程序,性能和用户体验更佳,界面设计更加简洁清新,同时打通微信小程序、QQ小程序、百度小程序、支付宝小程序、头条小程序...真正实现一站多端,可使用微信扫描下方小程序码直接体验:

微慕增强版
@@ -219,9 +260,9 @@ if (version_compare(PHP_VERSION, '5.6.0', '<=') )
微慕官网
微慕商城
-

微慕版wordpress小程序和插件,在“守望轩”开源小程序的基础上,架构完全重构,在性能上大幅度优化,增加了动态圈子、积分系统、文章投稿、发布动态、付费阅读、会员权限、多种图文列表样式、预约表单、模板消息等功能,并且免费提供标准版、旅游版、图片版、企业版4套前端模板,可使用微信扫描下方小程序码直接体验:

+

微慕版专业版WordPress小程序和插件,在“守望轩”开源小程序的基础上,架构完全重构,在性能上大幅度优化,增加了动态圈子、积分系统、文章投稿、发布动态、付费阅读、会员权限、多种图文列表样式、预约表单、模板消息等功能,并且免费提供标准版、旅游版、图片版、企业版4套前端模板,可使用微信扫描下方小程序码直接体验:

- 微慕专业版 + 微慕专业版
diff --git a/rest-api-to-miniprogram.php b/rest-api-to-miniprogram.php index 2dea2f3..4694981 100644 --- a/rest-api-to-miniprogram.php +++ b/rest-api-to-miniprogram.php @@ -3,7 +3,7 @@ Plugin Name: REST API TO MiniProgram Plugin URI: http://www.watch-life.net Description: 为微信小程序、app提供定制WordPress REST API 输出.支持微信支付、微信小程序模板消息. -Version: 1.5.8 +Version: 1.6.0 Author: jianbo Author URI: http://www.minapper.com License: GPL v3 @@ -19,6 +19,7 @@ include(REST_API_TO_MINIPROGRAM_PLUGIN_DIR . 'includes/ram-util.php' ); include(REST_API_TO_MINIPROGRAM_PLUGIN_DIR . 'includes/ram-api.php' ); include(REST_API_TO_MINIPROGRAM_PLUGIN_DIR . 'includes/ram-weixin-api.php'); include(REST_API_TO_MINIPROGRAM_PLUGIN_DIR . 'includes/settings/wp-wechat-config.php'); +include(REST_API_TO_MINIPROGRAM_PLUGIN_DIR . 'includes/settings/wp-post-config.php'); include(REST_API_TO_MINIPROGRAM_PLUGIN_DIR . 'includes/filter/ram-custom-comment-fields.php'); include(REST_API_TO_MINIPROGRAM_PLUGIN_DIR . 'includes/filter/ram-custom-content.php'); include(REST_API_TO_MINIPROGRAM_PLUGIN_DIR . 'includes/filter/ram-custom-post-fields.php'); @@ -58,6 +59,7 @@ if ( ! class_exists( 'RestAPIMiniProgram' ) ) { //new WP_Category_Config(); add_action('admin_menu', 'weixinapp_create_menu'); add_filter( 'plugin_action_links', 'ram_plugin_action_links', 10, 2 ); + wp_post_config(); } @@ -89,6 +91,10 @@ if ( ! class_exists( 'RestAPIMiniProgram' ) ) { return $links; } + $settings_link = ' ' . esc_html__( '升级增强版', 'REST API TO MiniProgram' ) . ''; + + array_unshift( $links, $settings_link ); + $settings_link = ' ' . esc_html__( '升级专业版', 'REST API TO MiniProgram' ) . ''; array_unshift( $links, $settings_link ); -- GitLab