当前位置: 首页>>代码示例>>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;未经允许,请勿转载。