dfghfghfgh
Monat: Juni 2022
tertsd
sdfgsdfg fsdfdsf
test
some conent…
Call a PHP function after a post publish in WordPress
Today in this article, I am going to tell you how to call a PHP function when a post update with status “publish” or a new post publishes on a WordPress site.
WordPress has an action which is publish_post that will trigger at the time of a post updated and the status of the post be “publish”.
Below is the code structure:
You above code that I have used the action hook and pass the function in it. All the required code will be inside the custom function call_after_post_publish() that I have created.
Well, we can also get the id of the author, author name, author email, post title, the link of the post inside the function just as you can see below: