Skip to content

Commit 4b5d4b5

Browse files
committed
Skip setting same status for translations when source status is trash
1 parent dc73c8f commit 4b5d4b5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plugins/bcc-keep-translated-posts-status-same-as-original/bcc-keep-translated-posts-status-same-as-original.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ function bcc_filter_on_wp_insert_post_data ( $data, $postarr ) {
5858
}
5959

6060
$source_status = $source->post_status; // 'draft', 'publish', 'pending', 'private', etc.
61-
if ( ! empty($source_status) && $data['post_status'] !== $source_status && $data['post_status'] != 'trash' ) {
61+
if ( ! empty($source_status) && $data['post_status'] !== $source_status
62+
&& $data['post_status'] != 'trash' && $source_status != 'trash' )
63+
{
6264
$data['post_status'] = $source_status;
6365
}
6466

0 commit comments

Comments
 (0)