Question
- what hook can be used to add a custom button to the ‘Publish’ metabox on the ‘Edit Post’ admin page?
Use case
I have a hand-rolled custom post type called ash_newsletter
. I want to add a button to the post.php?post={$post->ID}&action=edit
admin page for this post type. The button will only appear after the post has been published. The button will only be clickable once. The button will be located in the “Publish” metabox.
My idea is that when the button is clicked, a script will check the current post status and will check that a post_meta, ash_already_ran==false. If both conditions pass, a function will be called that contacts another service. If the function returns true, ‘ash_already_ran’ will be updated to true.
This will get you started;
add_action( 'post_submitbox_misc_actions', 'custom_button' );
function custom_button(){
$html="<div id="major-publishing-actions" style="overflow:hidden">";
$html .= '<div id="publishing-action">';
$html .= '<input type="submit" accesskey="p" tabindex="5" value="Customize Me!" class="button-primary" id="custom" name="publish">';
$html .= '</div>';
$html .= '</div>';
echo $html;
}
Adds a custom button to Publish Meta Box – example;

So far you still need to;
- register the custom button on your custom post type only
- write conditional check for to only show button when post has post_status of publish
- write custom function to call your custom service
I need to go now, but do attempt to tackle the points above and post your results. I’ll return tomorrow to see where you’re at and if I anyone else can help further.