Rest API
-
So I’m trying to get the events list to be accessed via REST. I know the plugin basically just makes a “event” custom post type so the following code should work to register it:
add_filter( 'register_post_type_args', 'my_post_type_args', 10, 2 ); function my_post_type_args( $args, $post_type ) { if ( 'event' === $post_type ) { $args['show_in_rest'] = true; } return $args; }
When I do this call up the schema event shows up as a possible query so the “show_in_rest” is registering the event post_type. However when I make a GET call to it all I get is an empty array. Anyone know what I need to do to get a list of events?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Rest API’ is closed to new replies.