morganestes
7/18/2018 - 8:02 PM

Expost post type to WP REST API

Expost post type to WP REST API

<?php
add_filter( 'register_post_type_args', function( $args, $post_type ) {
	if ( 'post_type_slug' === $post_type ) {
		$args['show_in_rest'] = true;
	}

	return $args;
}, 10, 2 );