Last active
December 17, 2015 06:19
-
-
Save alana-mullen/5565008 to your computer and use it in GitHub Desktop.
Adding support for Custom Post Types in the WordPress Jetpack REST API. The example adds support for the Custom Post Type named 'portfolio'. You would add this function to the functions.php in your theme or a plugin.
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
<?php | |
add_filter( 'rest_api_allowed_post_types', 'allow_my_post_types'); | |
function allow_my_post_types($allowed_post_types) { | |
$allowed_post_types[] = 'portfolio'; | |
return $allowed_post_types; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment