I'm trying to search WP_Query for the data containing the phrase "Dalton's Law" in
meta_query. This is an
AJAX search, and here's what I"m doing:
//in this case $_POST['query'] is the phrase "Dalton's Law" $query = apply_filters( 'get_search_query', $_POST['query'] ); $query = esc_html( $query ); $guide_meta_args = array( 'post_type' => array( 'guide' ), 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'posts_per_page' => 4, 'meta_query' => array( array( 'key' => 'guide_raw_data', 'value' => $query, 'compare' => 'LIKE', ), ) );
console.log the search string and it is
dalton\'s So it appears that the encoding is working properly, but
WP_Query doesn't like the apostrophe... does anyone have suggestions? Thanks so much!