wp rest api support modern tribes calender empty response

I am trying to get the feed from modern tribe events calender by adding wp rest api support using following code

add_action( 'init', 'w3_events_rest', 25 );

function w3_events_rest() {
  global $wp_post_types;
  $post_type_name = 'tribe_events';

  if( isset( $wp_post_types[ $post_type_name ] ) ) {
      $wp_post_types[$post_type_name]->show_in_rest = true;
      $wp_post_types[$post_type_name]->rest_base = $post_type_name;
      $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
  }

}

add_action( 'init', 'w3_events_category', 25 );
function w3_events_category() {
  global $wp_taxonomies;
  $taxonomy_name = 'tribe_events_cat';

  if ( isset( $wp_taxonomies[ $taxonomy_name ] ) ) {
    $wp_taxonomies[ $taxonomy_name ]->show_in_rest = true;
    $wp_taxonomies[ $taxonomy_name ]->rest_base = $taxonomy_name;
    $wp_taxonomies[ $taxonomy_name ]->rest_controller_class = 'WP_REST_Terms_Controller';
  }
}

but when I try to fetch the feed using

http://example.com/wp-json/wp/v2/tribe_events

it returns empty feed just the empty square bracket []

Though the event author says they don’t support wp rest api .. but I guess every custom post type should support it at least the read capability using

'show_in_rest',
'rest_base',
'rest_controller_class'  

So it seems something is wrong.. Please help me out ..

Read more here: wp rest api support modern tribes calender empty response

Leave a Reply

Your email address will not be published. Required fields are marked *