I have small issue with orderby. I´m looking solution to orderby ASC (lastname + firstname) example:
- Selanne Andy
- Selanne Beeny
- Selanne Teemu
But now it arrays something like this:
- Selanne Beeny
- Selanne Teemu
- Selanne Andy
Here is code:
$order_by_1 = array(
'meta_key' => 'last_name',
'meta_query' => array(
array(
'key' => 'last_name',
'orderby' => 'meta_value',
'order' => 'ASC'
),
array(
'key' => 'first_name',
'orderby' => 'meta_value',
'order' => 'ASC'
),
),
'orderby' => 'meta_value',
'order' => 'ASC'
);
$usr_1 = get_users($order_by_1);
// Array of stdClass objects.
foreach ( $usr_1 as $user ) { ....
Thanks for the help.