Correctly join post meta to fix order searches Closes #4855

This commit is contained in:
Mike Jolley 2014-02-19 16:11:16 +00:00 committed by Coen Jacobs
parent c2e76851b2
commit f42d1a1e6f
1 changed files with 2 additions and 1 deletions

View File

@ -578,7 +578,8 @@ class WC_Admin_CPT_Shop_Order extends WC_Admin_CPT {
$wpdb->get_col(
$wpdb->prepare( "
SELECT p1.post_id
FROM {$wpdb->postmeta} p1, {$wpdb->postmeta} p2
FROM {$wpdb->postmeta} p1
INNER JOIN {$wpdb->postmeta} p2 ON p1.post_id = p2.post_id
WHERE
( p1.meta_key = '_billing_first_name' AND p2.meta_key = '_billing_last_name' AND CONCAT(p1.meta_value, ' ', p2.meta_value) LIKE '%%%s%%' )
OR