本文整理匯總了PHP中WP_User_Query::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP WP_User_Query::__construct方法的具體用法?PHP WP_User_Query::__construct怎麽用?PHP WP_User_Query::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WP_User_Query
的用法示例。
在下文中一共展示了WP_User_Query::__construct方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: WishListMemberUserSearch
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);
}
示例2: GuestParty
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});
}
}
}
示例3: array
function __construct($query = null)
{
add_action('pre_user_query', array(&$this, 'filter_registered_users_only'));
parent::__construct($query);
}