How to call a REST endpoint when a post is published?
You don’t have to write a new plugin. You can either add the code to your theme’s functions.php file, or create a child theme. To wrap your data in a JSON format, you can use the json_encode function. Hook into the post when it’s published, and send the data. In the following function, i will … Read more