Created
April 29, 2022 21:30
-
-
Save someguy9/e5576b1b746d781bb50aedf8911f5897 to your computer and use it in GitHub Desktop.
Query multiple meta key values in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$meta_query_args = array( | |
'meta_query' => array( | |
array( | |
'key' => 'city_name', | |
'value' => array('New York City', 'London', 'San Francisco'), | |
'compare' => 'IN' | |
) | |
) | |
); | |
$meta_query = new WP_Query( $meta_query_args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment