0

I am very newbie in wordpress and stuck into a task for many hours and not getting any way to sort out this, Thats why I am here....

I want to display a sort list of user based on meta key and meta value but I dont Know what wrong with me I searched google and did as retrieve...

I am trying as:

<?php
$args  = array(  
  'fields' => 'all_with_meta',  
  'meta_query' => array(  
    array(  
    'key' => 'status', // the meta field (or key) we want to target  
    'value' => '1'  // the value we want to target (optional)  

    )  
));  

$users = get_users($args);  
foreach ($users as $client) {
        echo '<li>' . $client->user_email . '</li>';
    }
?>

and in wp meta user table: meta_key=>'status' and meta_value=>'1' for three rows but it showing constant result for any value of meta_value.

Please let me know why I am not getting my desire output... thank you

4

0 回答 0