Title: Filter WP Api
Author: ogulcan
Published: <strong>2017 年 9 月 30 日</strong>
Last modified: 2017 年 10 月 21 日

---

搜索插件

![](https://ps.w.org/filter-wp-api/assets/banner-772x250.png?rev=1738881)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/filter-wp-api/assets/icon-256x256.png?rev=1738881)

# Filter WP Api

 作者：[ogulcan](https://profiles.wordpress.org/ogulcan/)

[下载](https://downloads.wordpress.org/plugin/filter-wp-api.zip)

 * [详情](https://cn.wordpress.org/plugins/filter-wp-api/#description)
 * [评价](https://cn.wordpress.org/plugins/filter-wp-api/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/filter-wp-api/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/filter-wp-api/#developers)

 [支持](https://wordpress.org/support/plugin/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.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Filter WP Api」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ ogulcan ](https://profiles.wordpress.org/ogulcan/)

[帮助将「Filter WP Api」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/filter-wp-api)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/filter-wp-api/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/filter-wp-api/)，或通过[RSS](https://plugins.trac.wordpress.org/log/filter-wp-api/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/filter-wp-api/)。

## 更新日志

#### 1.0

Initial version.

## 额外信息

 *  版本 **1.1.0**
 *  最后更新：**9 年前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 4.7 或更高版本 **
 *  已测试的最高版本为 **4.8.28**
 *  PHP 版本 ** 5.2.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/filter-wp-api/)
 * 标签
 * [api](https://cn.wordpress.org/plugins/tags/api/)[filter](https://cn.wordpress.org/plugins/tags/filter/)
   [wp-json](https://cn.wordpress.org/plugins/tags/wp-json/)
 *  [高级视图](https://cn.wordpress.org/plugins/filter-wp-api/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/filter-wp-api/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/filter-wp-api/reviews/)

## 贡献者

 *   [ ogulcan ](https://profiles.wordpress.org/ogulcan/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/filter-wp-api/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://github.com/ogulcan)