您可以使用以下代码进行此操作。您只需更改;posttype“;在要从批量操作中删除其草稿的操作名称中。
function remove_draft_from_bulk_actions( $actions ) {
if( isset( $actions[ \'draft\' ] ) ) {
unset( $actions[ \'draft\' ] );
}
return $actions;
}
add_filter( \'bulk_actions-edit-posttype\', \'remove_draft_from_bulk_actions\', 99 );
Below is the screenshot for this:
