Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Currently, I have a function called 'pub_notification' in my functions.php file which sends an email when the post is published, using the following code:

add_action('publish_post', 'pub_notification');

I would like to separate these functions by adding another button called 'Send Notification' below the default 'update/publish' button, which, when clicked, would save the post, including the custom field data, and then execuite my 'pub_notification' function.

Any help would be very much appreciated.

Of course this means I do not want to tie the execution of my 'pub_notification' function to either 'save_post' or 'publish_post' actions, but rather I want it tied to the click of the 'Send Notification' button.

share|improve this question
add comment

1 Answer 1

On first look it doesn't seem that there is a filter or action tied to the meta-box to allow you to do this. My bust suggestion would be to add a custom meta-box that includes the Notification button, and from that click you should be able call the save post function and then call your custom notification.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.