i’ve created consumer vote that may vote customers or writer of posts. so for instance have 4 customers which seems:
-
consumer — ID=1 — META KEY=’_thumbs_rating_up’ — META VALUE=’13’
-
consumer — ID=2 — META KEY=’_thumbs_rating_up’ — META VALUE=’17’
-
consumer — ID=3 — META KEY=’_thumbs_rating_up’ — META VALUE=’8′
-
consumer — ID=4 — META KEY=’_thumbs_rating_up’ — META VALUE=’241′
So i need to order these customers by consumer meta key and meta worth from heighest to lowwer. So i’ve these code now however order is just not appropriate:
<?php
$args = array(
'position' => 'Vendor',
'meta_key' => '_thumbs_rating_up',
'orderby' => 'meta_value_num'
);
// The Question
$user_query = new WP_User_Query( $args );
// Consumer Loop
if ( ! empty( $user_query->outcomes ) ) {
foreach ( $user_query->outcomes as $consumer ) {
echo '<p>' . get_avatar( $user->ID, 32 ) . '</p>';
echo '<p>' . get_user_meta($user->ID, '_thumbs_rating_up', true). '</p>';
echo '<p>' . $user->display_name . '</p>';
}
} else {
echo 'No customers discovered.';
}
?>
what i do flawed or just cannot order my customized meta key??????
- i discover the publish right here which has similarities however i dont know the way am i able to assist with these solutions: Kind customers by meta_value_num