本文整理汇总了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);
}