Created
September 22, 2015 16:21
-
-
Save misfist/9a9b5eb566313ad93181 to your computer and use it in GitHub Desktop.
Add custom post type to Rest API
This file contains hidden or 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
register_post_type('service', | |
array( | |
'labels' => array( | |
'name' => __('Services'), | |
'singular_name' => __('service') | |
), | |
'public' => true, | |
'has_archive' => true, | |
'show_in_rest' => true, //Adds the custom post type to the rest api | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment