Created
October 7, 2015 14:34
-
-
Save modemlooper/844e4b5e22a7b4034dbe to your computer and use it in GitHub Desktop.
add custom post type to WP-API
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 wpsd_add_events_args() { | |
global $wp_post_types; | |
$wp_post_types['incsub_wiki']->show_in_rest = true; | |
$wp_post_types['incsub_wiki']->rest_base = 'wiki'; | |
$wp_post_types['incsub_wiki']->rest_controller_class = 'WP_REST_Posts_Controller'; | |
} | |
add_action( 'init', 'wpsd_add_events_args', 30 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment