diff --git a/includes/admin/post-types/class-wc-admin-cpt-shop_order.php b/includes/admin/post-types/class-wc-admin-cpt-shop_order.php index 22b23f64e35..4f9d21060ff 100644 --- a/includes/admin/post-types/class-wc-admin-cpt-shop_order.php +++ b/includes/admin/post-types/class-wc-admin-cpt-shop_order.php @@ -193,9 +193,13 @@ class WC_Admin_CPT_Shop_Order extends WC_Admin_CPT { if ( $post->comment_count ) { + // check the status of the post + ( $post->post_status !== 'trash' ) ? $status = '' : $status = 'post-trashed'; + $latest_notes = get_comments( array( - 'post_id' => $post->ID, - 'number' => 1 + 'post_id' => $post->ID, + 'number' => 1, + 'status' => $status ) ); $latest_note = current( $latest_notes );