You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$search_query = $wpdb->prepare( " AND ( $wpdb->posts.post_title LIKE %s OR $wpdb->posts.post_name LIKE %s OR wc_product_meta_lookup.sku LIKE %s OR $wpdb->posts.post_content LIKE %s OR $wpdb->posts.post_excerpt LIKE %s ) ", $search, $search, $search, $search, $search );
313
+
$args['where'] .= $search_query;
314
+
315
+
if ( ! strstr( $args['join'], 'wc_product_meta_lookup' ) ) {
316
+
$args['join'] .= " LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup ON $wpdb->posts.ID = wc_product_meta_lookup.product_id ";
317
+
}
318
+
319
+
return$args;
320
+
}
321
+
287
322
/**
288
323
* This sets up the "allowed" args, and translates the GraphQL-friendly keys to WP_Query
289
324
* friendly keys. There's probably a cleaner/more dynamic way to approach this, but
@@ -309,6 +344,7 @@ public function sanitize_input_fields( array $where_args ) {
0 commit comments