這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

WP Rest API Customizer

外掛說明

WP Rest API Customizer provides an easy to use interface to modify WP rest API response. Sometimes you may need to remove few unnecessary JSON objects from the response to improver performance of your application. This plugin can do it for you.

Major features in WP Rest API Customizer include:

  • Adds Large, Medium and Small featured image URL’s to JSON response.
  • Enables adding comments from third party clients without user authentication.
  • Add’s a new route to get post id from post url.
  • You can unset any object you don’t need from /wp-json/wp/v2/posts end point.

螢幕擷圖

  • Enable new routes
  • Modify existing routes

安裝方式

The quickest method for installing the WP Rest API Customizer is:

  1. Visit Plugins -> Add New in the WordPress dashboard.
  2. Search for WP REST API Customizer without quotes in search box.
  3. Click “Install”.
  4. Finally click Activate Plugin.
  5. Go to Settings -> WP Rest API Customizer and check the desired fields to modify the defualt WP API response.

If you would prefer to do things manually then follow these instructions:

  1. Extract the dowloaded plugin file.
  2. Upload the wp-rest-api-customizer folder to the /wp-content/plugins/ directory
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. Go to Settings -> WP Rest API Customizer and check the desired fields to modify the defualt WP API response.

常見問題集

Will my app performance increase if I uncheck all fields?

No, you should not uncheck everything without understanding their actual usage. Few of them might be used by your theme, other plugins are even your app.

I enabled POST ID from POST URL custom route, how to use it?

By enabling it, you created a new route. Send a GET request to https://www.geekdashboard.com/wp-json/wp-rest-api-customizer/url-to-id and add your post url in header with key ‘url’

Is enabling comments without authorization is safe?

Yes, it is completely safe. But make sure you enabled comment moderation in WordPress settings -> Discussion to prevent spam comments.

What is the use of adding featured image urls. I’m already getting image id’s?

It depends on your requirements. Assume you’re showing 20 recent posts with title and feature image in your Android application. By addig featured image url’s to JSON object, you’re saving 20 requests and ultimately saving user’s data, your site bandwidth and improving app performance. Presto!

Can I create my own routes with this plugin?

Currently our plugin didn’t support creating own routes. We are planning it in next updates. However if you need a custom router which is useful to others (like gettig post id from post url), ask us via support. We’ll add it and update the plugin.

How can I contribute to WP Rest API Customizer?

You can get in touch with from our blog or contact us page and we’ll have a discussion.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈WP Rest API Customizer〉的開發相關工作。

參與者

將〈WP Rest API Customizer〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.1

Release Date – 4 September 2017

  • Readme file updated.
  • Plugin icon updated.

1.0

Release Date – 30 August 2017

  • Initial release.