这不是权限问题-贡献者可以(默认情况下)将帖子从挂起更改为草稿。要进行测试,请提交一篇文章供审阅,然后“快速编辑”它-您将看到您可以将状态更改回草稿。
问题是,一旦提交帖子供审阅,UI中的“另存为草稿”按钮就会被隐藏-让我们“还原”它:
function wpse_210259_revert_to_draft_button() {
global $post;
$post_type = get_post_type_object( $post->post_type );
if ( $post->post_status === \'pending\' && ! current_user_can( $post_type->cap->publish_posts ) ) {
printf(
/**
* Since there are no hooks where the original "Save Draft" button
* appears, use CSS positioning to "fake" it to give the user a
* consistent UI.
*/
\'<button style="position: absolute; top: 10px; left: 10px;" class="button" type="submit" name="post_status" value="draft">%s</button>\',
__( \'Save as Draft\' )
);
}
}
add_action( \'post_submitbox_misc_actions\', \'wpse_210259_revert_to_draft_button\' );