Mostly a PHP question but if I understand your question, you want something like this:
$args = array(
'role' => 'talent',
'order' => 'DESC',
'orderby' => 'user_registered',
'meta_key' => 'position',
'number' => '15'
);
$meta = array (
array(
'key' => 'picture',
'value' => array(''),
'compare' => 'NOT IN'
),
array(
'key' => 'position',
'value' => $title
)
);
$orderby_options = array(
'All' => 'All',
'Male' => 'Male',
'Female' => 'Female',
);
// var_dump($_GET);
if (!empty($_GET['gender']) && in_array($_GET['gender'],$orderby_options)) {
$meta[] = array(
'key' => 'gender',
'value' => $orderby_options[$_GET['gender']]
);
}
Related Posts:
- WP_User_Query to exclude users with no posts
- WP_User_Query will not combine meta + normal search methods
- WP_User_Query users by registered date
- User appears twice in a WP_User_Query
- Want to add my custom prepare query but add_filter doesn’t run
- each_connected in wp_user_query with Scribu’s Posts to Posts Plugin – Alternative method? [closed]
- Sort WP_User_Query by meta_key value with pre_user_query
- WP_User_Query Custom Field meta_query with Date clause
- Ordering WP_User_Query results by the user IDs used in the include parameter
- Get users in query and limit user output to five in random order
- Echo the number of users using WP_User_Query?
- Query Users by login, meta & role
- Basic Wp_user_query not finding any users
- Modify user table search results
- WP_User_Query not displaying any user [closed]
- Is it necessary to escape LIKE term in WP_User_Query?
- Exclude Users of a Certain Role in the Users Page
- Save users last visited blogs within whole network
- Snippett for create field in registration for users
- WordPress WP_User_Query($args) using Where and Like
- WP_User_Query unexpected output after upgrading toWordPress 4.0.1
- custom post type ‘pre_[cpt]_query’ hook
- Can you return users of a higher role than the current user using get_users()?
- WP_User_Query with 2 sets of conditions ‘AND’
- unable to modify user table search results based on meta key
- Problem with WP_User_Query when ‘meta_value’ is an array
- Wp_user_query search by meta_key not returning any results
- WP_User_Query is Not Displaying Results
- How to display pagination links for WP_User_Query?
- List users by last name in WP_User_Query
- How to order WP_User_Query results to match the order of an array of user IDs?
- Searching users with WP_List_Table plugin
- WP_User_Query with combined meta query – not working?
- How to add custom query filters in WP_User_Query
- Check if WP_User_Query ‘include’ is empty
- Get Y random authors’ ID/Object with more than X number of posts
- Searching user meta using WP_User_Query
- WP CLI – show users whose ID is larger than given ID
- How to display next and prev pagination links with WP_User_Query?
- How to get user by display_name with WP_User_Query
- get_users / WP_User_Query returns empty when logged out
- Users instead of posts: How to modify the main query?
- How to use search_columns in WP_User_Query?
- how to create a proper query for getting a list of users with taxonomy related meta key
- WP User Query fails when searching meta queries and search columns
- Getting users by specific capability, not role
- Query users by capability – uninstall/deactivate callback
- WP_Query ordered by meta_value_num doesn’t fetch posts without this meta field
- WP_User_Query pulling ACF to loop
- WordPress search posts by author name with autocomplete
- how to know when the user is in specific part of the website and when he leaves that part and display the data in the admin dashboard
- How to show user online status on their posts?
- pagination with numbers for WP_User_Query
- WP_User_Query – searching multiple fields
- Get users that likes the post
- Passing args to WP_User_Query am I using meta correctly?
- Accessing current users data within a plugin
- WP_User_Query not returning users with meta – what am I missing?
- Randomize Users
- Normal PHP array for exclude section of WordPress query?
- How to get the count
- creating new field on mysql
- array of meta values using WP_User_Query
- meta query based on month regardless of year
- Display the line breaks in user bio without using html
- How to properly use AND / OR in custom search
- meta_query in WP_User_Query not working – returns every user, not just users where key & value matches
- Can I use paginate_links() to add a pagination list, yet prevent it from inserting links?
- Add Watermark to PDF’s of logged in user in WordPress upon upload to media library [closed]
- How do I remove duplicate users from two merged WP_User_Query objects?
- Change users.php WP_User_Query
- How to put an array in wp user query
- WP_User_Query orderby meta_val_num
- Is it possible to use WP_USER_QUERY to search by username using a wildcard? [closed]
- WordPress get last inserted user id
- User query – getting values for custom meta keys/fields
- How do I echo all users’ display_name and their meta_value who have a certain meta_key?
- Wrong result in fetching User meta of WordPress
- Get a Post Loop based on Logged in User information into a Shortcode
- How to optimize the opening speed of admin panel?
- SQL to set Display Name to First Name + Last Name
- SQL to join u3g_users & u3g_meta_value with repeating data
- Getting user data via ajax
- Find count of WordPress users by role and search string for user name
- How to display replies to his comments in user profile of current user
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- Get label in user meta query
- Create a unique username with validation on wordpress registration
- WP_User_Query Orderby Not Working
- How to query 5 users in random who have published more than 10 posts
- WP_User_Query not searching numbers?
- WP_User_Query counter not updating with pagination
- Why Am I getting an error when I add the number parameter to my WP_User_Query?
- Get Sticky User in user loop based on user role
- How to order users alphabetically by name? in plugin UPME
- How to fetch WP_User_Query with multiple role arguments [duplicate]
- Query Users by post count, last 30 days and display each users post count according to post type
- Shortcode for displaying the user’s first name?
- Show only users with the same role in Dashboard user list
- User Query Multiple Orderby Clause