WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer


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.