Ecommerce Shopify WordPress Discussion

WordPress REST API request to make custom post type with ACF fields

I have a WordPress site running and I'm trying to use the rest API to create a custom post of a new type I already defined and want to fill in the ACF fields but because it's a custom page type it's not working and I don't know why. I followed this example from https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-rest-api-support-for-custom-content-types/ add_action( 'init', 'my_book_cpt' ); function my_book_cpt() { $args = array( 'public' => true, 'show_in_rest' => true, 'label' => 'Books' ); register_post_type( 'book', $args ); } Put the code in wp-functions.php and tried to save it by going to settings>permalinks and hitting save to try to reload the configuration but it doesn't seem to be working If I go to the API url and search basically "Book" doesn't appear at all Should I be putting the code somewhere else? Is there a better way to do this now? The documentation I wrote above doesn't seem to detail where you should put that code. The error is basically the route is invalid at that url
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.