Skip to content

Instantly share code, notes, and snippets.

@flexseth
Forked from brendannee/gist:7196251
Created March 26, 2016 21:12
Show Gist options
  • Save flexseth/ff1f9881c2d069c2f9cc to your computer and use it in GitHub Desktop.
Save flexseth/ff1f9881c2d069c2f9cc 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 fp_allow_my_post_types($allowed_post_types) {
$allowed_post_types[] = 'tribe_events';
return $allowed_post_types;
}
add_filter( 'rest_api_allowed_post_types', 'fp_allow_my_post_types');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment