get_users multiple meta keys
-
Hi
I am displaying a list of users that have a value for a meta field ‘offer’;
$usersWithOffer = get_users(array( 'meta_key' => 'offer', 'meta_compare' => '!==', 'meta_value' => '' ));
I also need to order this list by another meta field ‘business’.
I added the other key and tried to order by it but it isn;t working
$usersWithOffer = get_users(array( 'meta_key' => 'offer', 'meta_compare' => '!==', 'meta_value' => '', 'meta_key' => 'business', 'orderby' => 'business', 'order' => 'ASC' ));
Can anyone let me know where I have gone wrong?
Thanks
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘get_users multiple meta keys’ is closed to new replies.