Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
Parameters
- $allowed_types
array Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
Changelog
- Introduced in 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');