Source file: sal/class.json-api-site-base.php
View in GitHubParameters
- $allowed_types
-
(array) Array of whitelisted post types. Default to array( 'post', 'page', 'revision' ).
Changelog
Since: Jetpack 2.2.3
How to use this hook
Notes
You can use this filter to whitelist some of your Custom Post Types and access them from the WordPress.com REST API:
function jeherve_allow_my_post_types( $allowed_post_types ) { $allowed_post_types[] = 'my_post_type'; return $allowed_post_types; } add_filter( 'rest_api_allowed_post_types', 'jeherve_allow_my_post_types');