Edit Reusable Block content using Json REST API POST call
-
Hi There,
I have created a Reusable block with this content:
<!– wp:woocommerce/product-best-sellers {“rows”:1,”categories”:[58,60]} /–>
I would like to change the categories that are displayed in this woocommerce product bestsellers block using a REST API Post call. For instance 58 & 60 should change to 40 & 41
This is how I have set up the rest API POST call:
URL: https://your-wordpress-site.com/wp-json/wp/v2/blocks/800
Method: POST
Body: {“content”: “<!– wp:woocommerce/product-best-sellers {“rows”:1,”categories”:[40,41]} /–>”}I can change the title of the block with an API call. But I haven’t been able to edit the content of the block.
How should I set up the Body of the API Call to edit the category ID??
For reference, here you can find the GET call of the block: https://www.webpagescreenshot.info/#v2=bgajAQsHH
- The topic ‘Edit Reusable Block content using Json REST API POST call’ is closed to new replies.