Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2. public function get_users($default_fields = null){
  3. global $wpdb;
  4.  
  5.  
  6.  
  7. $this->build_query($default_fields);
  8. $results = $wpdb->get_results( $this->query );
  9.  
  10. $total = $wpdb->get_var( 'SELECT FOUND_ROWS()' );
  11. $users = $this->db_rows_to_objects($results);
  12.  
  13.  
  14.  
  15. $all_users = count_users();
  16. return array('users'=>$users, 'total'=> $total, 'alltotal'=>$all_users['total_users']);
  17.  
  18. }
  19.  
  20. $users = array();
  21. foreach ($results as $user)
  22. if (!user_can( $user->ID, 'manage_options' ))
  23. $users[] = $user;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement