Wildcard with LIKE operator in Meta query
Have you var_dumped $location? WP_Query‘s meta_query uses the class WP_Meta_Query, which automatically appends and prepends ‘%’ to any string passed to it: // From wp-includes/class-wp-meta-query.php:610 switch ( $meta_compare ) { // … case ‘LIKE’ : case ‘NOT LIKE’ : $meta_value=”%” . $wpdb->esc_like( $meta_value ) . ‘%’; $where = $wpdb->prepare( ‘%s’, $meta_value ); break; // … … Read more