apply_filters ( 'rest_api_allowed_post_types', array $allowed_types )

Filter the post types Jetpack has access to, and can synchronize with

Source file: sal/class.json-api-site-base.php

View in GitHub



(array) Array of whitelisted post types. Default to array( 'post', 'page', 'revision' ).


Since: Jetpack 2.2.3

How to use this hook

See Using actions and filters to customize Jetpack.


You can use this filter to whitelist some of your Custom Post Types and access them from the 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');

Have a note to contribute?