Title: REST API Enabler
Author: Mickey Kay
Published: <strong>9 Tháng 10, 2015</strong>
Last modified: 4 Tháng 7, 2016

---

Tìm kiếm plugin

Plugin này **chưa được cập nhật với 3 phiên bản mới nhất của WordPress**. Nó có 
thể không được hỗ trợ và bảo trì, và có thể xung đột với các phiên bản WordPress
mới nhất.

![](https://s.w.org/plugins/geopattern-icon/rest-api-enabler.svg)

# REST API Enabler

 Bởi [Mickey Kay](https://profiles.wordpress.org/mcguive7/)

[Tải về](https://downloads.wordpress.org/plugin/rest-api-enabler.1.1.0.zip)

 * [Chi tiết](https://vi.wordpress.org/plugins/rest-api-enabler/#description)
 * [Đánh giá](https://vi.wordpress.org/plugins/rest-api-enabler/#reviews)
 *  [Cài đặt](https://vi.wordpress.org/plugins/rest-api-enabler/#installation)
 * [Nhà phát triển](https://vi.wordpress.org/plugins/rest-api-enabler/#developers)

 [Hỗ trợ](https://wordpress.org/support/plugin/rest-api-enabler/)

## Mô tả

**Like this plugin? Please consider [leaving a 5-star review](https://wordpress.org/support/view/plugin-reviews/rest-api-enabler).**

By default, custom post types and custom fields are not accessible via the WordPress
REST API. REST API Enabler allows you to:

 1. Enable the WP REST API for custom post types and specify WP REST API custom endpoints.
 2. Choose which custom fields to include in WP REST API responses for posts, pages,
    and custom post types.

All enabled custom field data is included in the REST API response, nested under
the `rest_api_enabler` key, like so:

    ```
    [
      {
        "id": 179,
        "date": "2016-07-03T18:06:50",
        "title": {
          "rendered": "Test Job"
        },
        .
        .
        .
        "rest_api_enabler": {
          "custom_meta_1": "Value 1",
          "custom_meta_2": "Value 2",
          "custom_meta_3": [
            "Array value 1",
            "Array value 2"
          ]
        }
      }
    ]
    ```

Note: prior to verion 1.1.0, all meta keys were included as top-level keys in the
API response. Additionally, all values were returned as arrays, regardless of whether
the original value was actually an array. This functionality is now deprecated as
it risks key-name collisions. Please reference the `rest_api_enabler` top-level 
key instead.

#### Usage

 1. Activate the plugin, then go to **Settings → REST API Enabler** in the admin.
 2. Click the **Post Types** tab to enable/disable post types and customize their endpoints.
 3. Click the **Post Meta** tab to enable/disable post meta (custom fields).

**NOTE:** by default, the plugin does not display settings for protected post meta(
post meta that begins with an underscore and is intended for internal use only).
If you wish to include protected post meta in the plugin settings, you can use the`
rae_include_protected_meta` filter to do so. The following code can be placed in
your theme’s `functions.php` file, or in a custom plugin (on `init` priority 10 
or earlier):

    ```
    add_filter( 'rae_include_protected_meta', '__return_true' );
    ```

## Ảnh màn hình

[⌊Enabling post types and customizing their endpoints.⌉⌊Enabling post types and 
customizing their endpoints.⌉[

Enabling post types and customizing their endpoints.

## Cài đặt

#### Manual Installation

 1. Upload the entire `/rest-api-enabler` directory to the `/wp-content/plugins/` directory.
 2. Activate REST API Enabler through the ‘Plugins’ menu in WordPress.

## Đánh giá

![](https://secure.gravatar.com/avatar/b56f301f4060d564494fc7d704536bc85ee810378fd71c03108265c7c298455d?
s=60&d=retro&r=g)

### 󠀁[Great !!](https://wordpress.org/support/topic/great-4725/)󠁿

 [imaginocharme](https://profiles.wordpress.org/imaginocharme/) 3 Tháng 9, 2016

Great job, save me a lot of time .

![](https://secure.gravatar.com/avatar/2eff02d9622e2f8af5a5f80cefa2ce50735dff2728eb8443308ca6995b6f133d?
s=60&d=retro&r=g)

### 󠀁[Nice Job….exactly what i needed](https://wordpress.org/support/topic/nice-jobexactly-what-i-needed/)󠁿

 [TomLeonard](https://profiles.wordpress.org/tomleonard/) 3 Tháng 9, 2016

Nice Job….exactly what i needed . Very easy settings and Meta data page made it 
a breeze to add . Thanks Mickey!!

![](https://secure.gravatar.com/avatar/cca9f1a3fb857e74c0a2724a3b186b2d8513579974140561095f1881eab3b584?
s=60&d=retro&r=g)

### 󠀁[straight to the point](https://wordpress.org/support/topic/straight-to-the-point-6/)󠁿

 [muhaye](https://profiles.wordpress.org/muhaye/) 3 Tháng 9, 2016

Thank you, this is a very simple yet usefull plugin. saved me the time to create
one my self

 [ Đọc tất cả 3 đánh giá ](https://wordpress.org/support/plugin/rest-api-enabler/reviews/)

## Người đóng góp & Lập trình viên

“REST API Enabler” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.

Những người đóng góp

 *   [ Mickey Kay ](https://profiles.wordpress.org/mcguive7/)

“REST API Enabler” đã được dịch qua 1 ngôn ngữ. Cảm ơn [những người tham gia dịch](https://translate.wordpress.org/projects/wp-plugins/rest-api-enabler/contributors)
vì đóng góp của họ.

[Dịch “REST API Enabler” sang ngôn ngữ của bạn.](https://translate.wordpress.org/projects/wp-plugins/rest-api-enabler)

### Muốn tham gia phát triển?

[Duyệt code](https://plugins.trac.wordpress.org/browser/rest-api-enabler/), check
out [SVN repository](https://plugins.svn.wordpress.org/rest-api-enabler/), hoặc 
theo dõi [nhật ký phát triển](https://plugins.trac.wordpress.org/log/rest-api-enabler/)
qua [RSS](https://plugins.trac.wordpress.org/log/rest-api-enabler/?limit=100&mode=stop_on_copy&format=rss).

## Nhật ký thay đổi

#### 1.1.0

 * Add mapping of meta keys to be nested under the new top level rest_api_enabler
   response key. Note: top-level key support is still maintained, though now considered
   deprecated.
 * Add functionality to support singular and array values, to prevent issue in which
   ALL values were previously returned as arrays.

#### 1.0.2

 * Fix issue in which media uploads via the REST API don’t work.

#### 1.0.1

 * Fix typo preventing post meta enabling.
 * Fix post meta alphabetical sorting.

#### 1.0.0

 * First release

## Meta

 *  Phiên bản **1.1.0**
 *  Cập nhật lần cuối **10 năm trước**
 *  Số lượt cài đặt **200+**
 *  Phiên bản WordPress ** 3.5 hoặc cao hơn **
 *  Đã kiểm tra lên đến **4.4.34**
 *  Ngôn ngữ
 * [Dutch](https://nl.wordpress.org/plugins/rest-api-enabler/) và [English (US)](https://wordpress.org/plugins/rest-api-enabler/).
 *  [Dịch sang ngôn ngữ của bạn](https://translate.wordpress.org/projects/wp-plugins/rest-api-enabler)
 * Thẻ
 * [api](https://vi.wordpress.org/plugins/tags/api/)[custom](https://vi.wordpress.org/plugins/tags/custom/)
   [post](https://vi.wordpress.org/plugins/tags/post/)[rest](https://vi.wordpress.org/plugins/tags/rest/)
   [type](https://vi.wordpress.org/plugins/tags/type/)
 *  [Nâng cao](https://vi.wordpress.org/plugins/rest-api-enabler/advanced/)

## Đánh giá

 5 trên 5 sao.

 *  [  3 5-star reviews     ](https://wordpress.org/support/plugin/rest-api-enabler/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/rest-api-enabler/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/rest-api-enabler/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/rest-api-enabler/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/rest-api-enabler/reviews/?filter=1)

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

[Xem tất cả đánh giá](https://wordpress.org/support/plugin/rest-api-enabler/reviews/)

## Những người đóng góp

 *   [ Mickey Kay ](https://profiles.wordpress.org/mcguive7/)

## Hỗ trợ

Có điều gì muốn nói? cần giúp đỡ?

 [Xem diễn đàn hỗ trợ](https://wordpress.org/support/plugin/rest-api-enabler/)

## Ủng hộ

Bạn có muốn hỗ trợ vào sự phát triển của plugin này?

 [ Ủng hộ plugin này ](http://wordpress.org/plugins/rest-api-enabler)