Reputation: 289
I need to determine if a user insert a post in the database
I have here this function
add_action("publish_post", "myFunc");
function myFunc(){
echo "Success!";
}
I've tried it on the QuickPress widget and it works fine but in the "Add new post" I didn't get any response.
What action type do I need for the "Add new post" module?
Thanks in advance!
Upvotes: 0
Views: 56
Reputation: 189
The action naame is save_post
(http://codex.wordpress.org/Plugin_API/Action_Reference/save_post). Any functions added on to here can be given the post id as an argument to do what you need.
The down side is that it is called each time a post is saved.
This action is used for saving custom meta box values from the post edit page
Hope this helps
Upvotes: 1