1

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.

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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