diff --git a/includes/admin/class-wc-admin-log-table-list.php b/includes/admin/class-wc-admin-log-table-list.php index 74e1cf8c12d..669867bbb6d 100644 --- a/includes/admin/class-wc-admin-log-table-list.php +++ b/includes/admin/class-wc-admin-log-table-list.php @@ -375,11 +375,11 @@ class WC_Admin_Log_Table_List extends WP_List_Table { $where_values[] = '%' . $wpdb->esc_like( wc_clean( wp_unslash( $_REQUEST['s'] ) ) ) . '%'; } - if ( ! empty( $where_conditions ) ) { - return $wpdb->prepare( 'WHERE 1 = 1 AND ' . implode( ' AND ', $where_conditions ), $where_values ); - } else { + if ( empty( $where_conditions ) ) { return ''; } + + return $wpdb->prepare( 'WHERE 1 = 1 AND ' . implode( ' AND ', $where_conditions ), $where_values ); } /**