Let private posts stay in status “private” after edit through “editors”

As it doesn’t look as though the OP is coming back, I’m adding their answer as an answer rather than leaving it in the question:

For everyone dealing with the same problem: I was able to fix it with
a code snippet of another thread:
https://wordpress.stackexchange.com/a/172556/87321

Just had to add the post status “pending”, so the working solution is:

add_filter('wp_insert_post_data', 'mark_post_private'); 
function mark_post_private($data)
{
    if(($data['post_type'] == 'your_post_type_goes_here') && ( $data['post_status'] == 'pending'))
    {
        $data['post_status'] = 'private';
    }

    return $data;
}

Leave a Comment