本文整理汇总了PHP中BP_Groups_Member::get_invites方法的典型用法代码示例。如果您正苦于以下问题:PHP BP_Groups_Member::get_invites方法的具体用法?PHP BP_Groups_Member::get_invites怎么用?PHP BP_Groups_Member::get_invites使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BP_Groups_Member
的用法示例。
在下文中一共展示了BP_Groups_Member::get_invites方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_get_invites_with_exclude
public function test_get_invites_with_exclude()
{
$g1 = $this->factory->group->create(array('name' => 'RC Cola'));
$g2 = $this->factory->group->create(array('name' => 'Pepsi'));
$u1 = $this->factory->user->create();
$u2 = $this->factory->user->create();
self::add_user_to_group($u1, $g1);
self::add_user_to_group($u1, $g2);
self::invite_user_to_group($u2, $g1, $u1);
self::invite_user_to_group($u2, $g2, $u1);
$groups = BP_Groups_Member::get_invites($u2, false, false, array('awesome', $g1));
$ids = wp_list_pluck($groups['groups'], 'id');
$this->assertEquals($ids, array($g2));
}
示例2: groups_get_invites_for_user
/**
* Get IDs of users with outstanding invites to a given group from a specified user.
*
* @param int $user_id ID of the inviting user.
* @param int|bool $limit Limit to restrict to.
* @param int|bool $page
* @param string|array|bool $exclude
*
* @return array $value IDs of users who have been invited to the group by the
* user but have not yet accepted.
*/
function groups_get_invites_for_user($user_id = 0, $limit = false, $page = false, $exclude = false)
{
if (empty($user_id)) {
$user_id = bp_loggedin_user_id();
}
return BP_Groups_Member::get_invites($user_id, $limit, $page, $exclude);
}
示例3: groups_get_invites_for_user
function groups_get_invites_for_user($user_id = 0, $limit = false, $page = false, $exclude = false)
{
global $bp;
if (!$user_id) {
$user_id = $bp->loggedin_user->id;
}
return BP_Groups_Member::get_invites($user_id, $limit, $page, $exclude);
}
示例4: groups_get_invites_for_user
function groups_get_invites_for_user($user_id = false)
{
global $bp;
if (!$user_id) {
$user_id = $bp->loggedin_user->id;
}
return BP_Groups_Member::get_invites($user_id);
}