Created
October 28, 2013 12:48
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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