您可以在函数中创建自定义按钮并将其挂接到post_submitbox_misc_actions
这会将其添加到“发布”按钮的正上方。
要更改状态,请使用wp_update_post 在Ajax函数中。尝试一下,如果遇到任何问题,请用代码发回。
UPDATE:
add_action(\'post_submitbox_misc_actions\', \'send_for_correction_button\');
function send_for_correction_button()
{
//global $post;
echo \'<div id="send-for-correction" class="misc-pub-section"
style="border-top-style:solid; border-top-width:1px; border-top-color:#EEEEEE; border-bottom-width:0px;">
<input id="save-post2" class="button button-highlighted"
type="submit" value="Send for correction" name="save">
</div>\';
}
add_filter( \'wp_insert_post_data\' , \'my_filter_handler\' , \'99\', 2 );
function my_filter_handler( $data , $postarr )
{
if ($postarr[\'save\'] == \'Send for correction\')
$data[\'post_status\'] = \'on-correction\';
return $data;
}