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