function WishListMemberUserSearch($search_term = '', $page = '', $role = '', $ids = 'no longer used', $sortby = '', $sortorder = '', $howmany = 15, $more_filters = array()) { if (empty($page)) { $page = 1; } $query = array('offset' => ($page - 1) * $howmany, 'role' => $role, 'number' => $howmany, 'orderby' => $sortby, 'order' => $sortorder, 'fields' => 'ID'); //add search term if not empty if (trim($search_term) != "") { $query['search'] = '*' . trim($search_term) . '*'; $query['search_columns'] = array('user_login', 'user_nicename', 'user_email'); } $this->SortOrder = $sortorder ? $sortorder : 'ASC'; $this->search_term = $search_term; $this->users_per_page = $howmany; $this->total_users = $this->total_users_for_query; $this->additional_filters = $more_filters; parent::__construct($query); }
function GuestParty($party_id) { parent::__construct(array('fields' => 'all_with_meta', 'meta_key' => '_wedding_party', 'meta_value' => $party_id)); $this->num_guests = count($this->results); foreach ($this->results as $user) { $user = new WeddingGuest($user->ID); if ($user->_attending_wedding == '1') { $this->attending_wedding++; } if ($user->_attending_dinner == '1') { $this->attending_dinner++; } if ($user->has_responded) { $this->num_responded++; } } $this->guests = $this->results; $do_not_unset = array('num_guests', 'num_responded', 'attending_wedding', 'attending_dinner', 'guests'); foreach ($this as $key => $val) { if (!in_array($key, $do_not_unset)) { unset($this->{$key}); } } }
function __construct($query = null) { add_action('pre_user_query', array(&$this, 'filter_registered_users_only')); parent::__construct($query); }