內容簡介
此外掛可協助 REST API 顯示精選媒體來源、作者、類別和自訂欄位。
此外掛是為Ionic Mobile App Builder製作的,適用於 Ionic 框架。
此外掛還支援在 metabox 中顯示自訂欄位,並且僅允許跨域請求 json 檔案。相容於 wp-restapi2 和 json-api。
功能:
- 產品清單無需 Woo API
- REST-API Auth Basic
- 修復 CORS 和 Preflight CORS(例如此問題:Request header field ……. is not allowed by Access-Control-Allow-Headers in preflight response.)
- Woo ACF 圖庫
- 圖庫JSON陣列或物件
- One Signal 推播
- 自訂欄位支援
- 修復 VisualComposer ([vc_row]Hello World . . .[/vc_row]) 渲染問題
WooCommerce
若要啟用 Woo 產品和類別無需授權,請在 wp-config.php 中加入此代碼
define("IMH_WOO", true);
您可以更改圖庫的自訂欄位(預設 Woo 使用 _product_image_gallery metakey),加入此行代碼
define("IMH_WOO_ACF_GALLERY", 'images');
和改為物件或字串格式(預設為字串,用逗號分隔)
define("IMH_WOO_ACF_GALLERY_OBJECT", false);
OneSignal 送出器
若要啟用 OneSignal 送出器,請在 wp-config.php 中加入此代碼
define("IMH_ONESIGNAL_PUSH", true);
然後修正您的 app_id 和 app_key
define("IMH_ONESIGNAL_PUSH", false);
define("IMH_ONESIGNAL_PAGE_IN_APP", 'post_singles'); //這個是其他資料(key:page and value:post_singles/post_id)
define("IMH_ONESIGNAL_APP_ID", '31ee45e2-c63d-4048-903a-89ca43f3afa2');
define("IMH_ONESIGNAL_APP_KEY", 'YzUzNmZkOTAtMmVlMC00OWIzLThlNGQtMzQyYzzyNmFhZjcw');
匿名留言
您可以使用以下設定允許匿名留言:
define("IMH_ALLOW_PREFLIGHT_CORS",true); //Method post 必需
define("IMH_ANONYMOUS_COMMENTS",true);
使用以下網址送出留言:
http://wordpress.co.id/wp-json/wp/v2/comments?author_name=Your Name Here&[email protected]&author_name=Your Name Here&content=Your Comment Here&post=20
註冊REST-API
您可以使用以下設定允許註冊新用戶:
define("IMH_RESTAPI_REGISTER",true);
端點:
https://wordpress.co.id/wp-json/wp/v2/users/register
Visual Composer
修復 VisualComposer 內容呈現問題
回應應是:
[vc_row]Hello World . . .[/vc_row]
正確的回應是:
Hello World . . .
在 wp-config.php 中加入此代碼
define("IMH_VC_SHORTCODE",true);
鳴謝
Ihsana Global Solusindo
IMA BuildeRz – Ionic Mobile App Builder + Code Generator
iWP-DevToolz – WordPress Plugin Maker + Code Generator
外掛標籤
開發者團隊
原文外掛簡介
This plugin help REST API for display featured media source, author, categories, and custom fields.
This plugin is made for Ionic Mobile App Builder, suitable used for ionic framework.
This plugin also support for display custom field in metabox and also make it allow crossorigin only for json files. Compatible with wp-restapi2 and json-api.
Features:
* Product listing without Woo API
* REST-API Auth Basic
* Fix CORS and Preflight CORS (Example Issue: Request header field ……. is not allowed by Access-Control-Allow-Headers in preflight response.)
* Woo ACF Gallery
* Gallery JSON Array or Object
* One Signal Push
* Custom Field Support
* Fix issue render VisualComposer ([vc_row]Hello World . . .[/vc_row])
Woocommerce
for enable Woo product and categories without authorization, add this code in wp-config.php
define("IMH_WOO", true);
You can changing custom field for gallery (default woo using _product_image_gallery metakey), add this line
define("IMH_WOO_ACF_GALLERY", 'images');
and for type data object or string (default string, separator with coma)
define("IMH_WOO_ACF_GALLERY_OBJECT", false);
OneSignal Sender
for enable oneSignal Sender add this code in wp-config.php
define("IMH_ONESIGNAL_PUSH", true);
then fix your app_id and app_key
define("IMH_ONESIGNAL_PUSH", false);
define("IMH_ONESIGNAL_PAGE_IN_APP", 'post_singles'); //this additional data (key: page and value: post_singles/post_id)
define("IMH_ONESIGNAL_APP_ID", '31ee45e2-c63d-4048-903a-89ca43f3afa2');
define("IMH_ONESIGNAL_APP_KEY", 'YzUzNmZkOTAtMmVlMC00OWIzLThlNGQtMzQyYzzyNmFhZjcw');
Anonymous Comments
You can allow anonymous comments using configuration:
define("IMH_ALLOW_PREFLIGHT_CORS",true); //required for method post
define("IMH_ANONYMOUS_COMMENTS",true);
send comment using url like this:
http://wordpress.co.id/wp-json/wp/v2/comments?author_name=Your Name [email protected]&author_name=Your Name Here&content=Your Comment Here&post=20
Register REST-API
You can allow register new user using configuration:
define("IMH_RESTAPI_REGISTER",true);
End Point:
https://wordpress.co.id/wp-json/wp/v2/users/register
Visual Composer
Fix issue render VisualComposer Content
Response is:
[vc_row]Hello World . . .[/vc_row]
Response should be:
Hello World . . .
add this code in wp-config.php
define("IMH_VC_SHORTCODE",true);
Credits
Ihsana Global Solusindo
IMA BuildeRz – Ionic Mobile App Builder + Code Generator
iWP-DevToolz – WordPress Plugin Maker + Code Generator
