Skip to content

Instantly share code, notes, and snippets.

@brendannee
Created October 28, 2013 12:48
Show Gist options
  • Save brendannee/7196251 to your computer and use it in GitHub Desktop.
Save brendannee/7196251 to your computer and use it in GitHub Desktop.
Whitelist a Wordpress custom post type for use with the Jetpack JSON API using the `rest_api_allowed_post_types` filter. See http://developer.wordpress.com/docs/api/1/get/sites/%24site/posts/
function allow_my_post_types($allowed_post_types) {
$allowed_post_types[] = 'my_post_type';
return $allowed_post_types;
}
add_filter( 'rest_api_allowed_post_types', 'allow_my_post_types');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment