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

Filter WP Api

描述

If you ever used WP Rest API, you should have noticed that there are lots of fields that even your client does not need. It makes no sense to load all fields for simple list or even single post view.

This plugin aims to remove redundant fields on Rest API. For now, it’s only available for posts.

Features

There are two endpoints: “compact” and “detailed.

  • “Compact” is useful for listing posts and Detailed is better for single post view.
  • First image of featured media will be added as ‘image’ on detailed and compact.
  • Modified was used as default date.
  • Requires at least WordPress 4.7

螢幕截圖

  • screenshot-1.png
  • screenshot-2.png

安裝

This section describes how to install the plugin and get it working.

  1. Upload the plugin files to the /wp-content/plugins/filter-wp-api directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. Use the Settings->Filter Rest Api screen to configure the plugin
  4. Both endpoints are enabled as default

常見問題

How to use compact and detailed endpoints?

Just add “?_compact” or “?_detailed” to end of api url.

Disabling plugin also disables rest api?

Nope. Just filtering fields will be disabled. Even you call endpoints, default data will be available.

Compact and detailed are not working for pages/category/author/media

Correct. This is a plugin that only filters for posts. Please stay tuned for more features.

評價

There are no reviews for this plugin.

貢獻者及開發者

“Filter WP Api” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Filter WP Api 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

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

修改日誌

1.0

Initial version.