apply_filters ( 'rest_api_allowed_post_types', array $allowed_types )

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

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

View in GitHub

Parameters

$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

See Using actions and filters to customize Jetpack.

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');

Have a note to contribute?