當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BP_Core_User::get_specific_users方法代碼示例

本文整理匯總了PHP中BP_Core_User::get_specific_users方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Core_User::get_specific_users方法的具體用法?PHP BP_Core_User::get_specific_users怎麽用?PHP BP_Core_User::get_specific_users使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BP_Core_User的用法示例。


在下文中一共展示了BP_Core_User::get_specific_users方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 function __construct($type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value)
 {
     global $bp;
     $this->pag_page = !empty($_REQUEST['upage']) ? intval($_REQUEST['upage']) : (int) $page_number;
     $this->pag_num = !empty($_REQUEST['num']) ? intval($_REQUEST['num']) : (int) $per_page;
     $this->type = $type;
     if (isset($_REQUEST['letter']) && '' != $_REQUEST['letter']) {
         $this->members = BP_Core_User::get_users_by_letter($_REQUEST['letter'], $this->pag_num, $this->pag_page, $populate_extras, $exclude);
     } else {
         if (false !== $include) {
             $this->members = BP_Core_User::get_specific_users($include, $this->pag_num, $this->pag_page, $populate_extras);
         } else {
             $this->members = bp_core_get_users(array('type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras, 'exclude' => $exclude, 'meta_key' => $meta_key, 'meta_value' => $meta_value));
         }
     }
     if (!$max || $max >= (int) $this->members['total']) {
         $this->total_member_count = (int) $this->members['total'];
     } else {
         $this->total_member_count = (int) $max;
     }
     $this->members = $this->members['users'];
     if ($max) {
         if ($max >= count($this->members)) {
             $this->member_count = count($this->members);
         } else {
             $this->member_count = (int) $max;
         }
     } else {
         $this->member_count = count($this->members);
     }
     if ((int) $this->total_member_count && (int) $this->pag_num) {
         $this->pag_links = paginate_links(array('base' => add_query_arg('upage', '%#%'), 'format' => '', 'total' => ceil((int) $this->total_member_count / (int) $this->pag_num), 'current' => (int) $this->pag_page, 'prev_text' => _x('←', 'Member pagination previous text', 'buddypress'), 'next_text' => _x('→', 'Member pagination next text', 'buddypress'), 'mid_size' => 1));
     }
 }
開發者ID:nxtclass,項目名稱:NXTClass-Plugin,代碼行數:34,代碼來源:bp-members-template.php

示例2: test_get_specific_users

 public function test_get_specific_users()
 {
     $u1 = $this->factory->user->create();
     $u2 = $this->factory->user->create();
     $u3 = $this->factory->user->create();
     $include_array = array($u1, 'junkstring', $u3);
     $users = BP_Core_User::get_specific_users($include_array);
     $user_ids = wp_parse_id_list(wp_list_pluck($users['users'], 'id'));
     $this->assertEquals(array($u1, $u3), $user_ids);
 }
開發者ID:JeroenNouws,項目名稱:BuddyPress,代碼行數:10,代碼來源:class-bp-core-user.php


注:本文中的BP_Core_User::get_specific_users方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。