Enable the WP REST API to work with custom post types, custom fields, and custom endpoints.
Like this plugin? Please consider leaving a 5-star review.
By default, custom post types and custom fields are not accessible via the WordPress REST API. REST API Enabler allows you to:
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.
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' );
/rest-api-enabler
directory to the /wp-content/plugins/
directory.