1.4
What's new
Raskoh now allows to you to add and remove your post types in WP REST API, from this version every post type will be included in WP REST API by default.
API
- Methods in
Raskoh\PostType::classsetRestControllerClass( string $class )setsrest_controller_classoption for the post typesetShowInRest( bool $showInRest )setsshow_in_restoption for the post typesetRestBase( string $restBase )setsrest_baseoption for the post type
Usage
Here is how you can use the above api while registering a post type
$product = new Raskoh\PostType('product');
$product->setShowInRest(true)
->setRestControllerClass('WP_REST_Posts_Controller')
->setRestBase('products-api')
->setIcon('dashicons-cart')
->register();Thanks to @JeyKeu