Last active
April 8, 2016 06:18
-
-
Save vijayrami/9628a459c5d31cfc847c43275dca2d74 to your computer and use it in GitHub Desktop.
Wordpress Get User Query
This file contains hidden or 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
| $country_m = $_REQUEST['country']; | |
| $statu_m = $_REQUEST['state']; | |
| $city_m = $_REQUEST['city']; | |
| $query_args = array( | |
| 'role' => 'vendor', | |
| 'meta_query' => array( | |
| 'relation' => 'AND', | |
| array( | |
| 'key' => 'country', | |
| 'value' => $country_m, | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'key' => 'state', | |
| 'value' => $statu_m, | |
| 'compare' => '=', | |
| ), | |
| array( | |
| 'key' => 'city', | |
| 'value' => $city_m, | |
| 'compare' => '=', | |
| ) | |
| ) | |
| ); | |
| $users = new WP_User_Query($query_args); | |
| Referance: http://mattvarone.com/wordpress/list-users-with-wp_user_query/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment