I don’t know if you can get one array to compare to the other directly, but you can create a loop to set up a meta_query array that will check for each of the IDs within the field separately:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | $tag_ids = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) ); $meta_query = array('relation' => 'OR'); foreach ($tags_ids as $tag_id) { $meta_query[] = array( 'key' => 'gametags', 'value' => $tag_id, 'compare' => 'IN' ); } $reviewArgs = array( 'post_type' => 'game', 'meta_query' => $meta_query ); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.