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


PHP BP_Groups_Member::remove方法代碼示例

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


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

示例1: groups_remove_member

/**
 * Remove a member from a group.
 *
 * @param int $user_id  ID of the user.
 * @param int $group_id ID of the group.
 *
 * @return bool True on success, false on failure.
 */
function groups_remove_member($user_id, $group_id)
{
    if (!bp_is_item_admin()) {
        // bp_is_item_admin may not be set if this function is called outside of group context.
        // Site admins and group admins can remove a member from a group.
        // A member may also request to remove herself from a group.
        if (!current_user_can('bp_moderate') && !groups_is_user_admin(bp_loggedin_user_id(), $group_id) && $user_id != bp_loggedin_user_id()) {
            return false;
        }
    }
    $member = new BP_Groups_Member($user_id, $group_id);
    /**
     * Fires before the removal of a member from a group.
     *
     * @since 1.2.6
     *
     * @param int $group_id ID of the group being removed from.
     * @param int $user_id  ID of the user being removed.
     */
    do_action('groups_remove_member', $group_id, $user_id);
    return $member->remove();
}
開發者ID:jasonmcalpin,項目名稱:BuddyPress,代碼行數:30,代碼來源:bp-groups-functions.php

示例2: groups_remove_member

function groups_remove_member($user_id, $group_id)
{
    if (!bp_is_item_admin()) {
        return false;
    }
    $member = new BP_Groups_Member($user_id, $group_id);
    do_action('groups_remove_member', $group_id, $user_id);
    return $member->remove();
}
開發者ID:novichkovv,項目名稱:candoweightloss,代碼行數:9,代碼來源:bp-groups-functions.php

示例3: groups_remove_member

/**
 * Remove a member from a group.
 *
 * @since 1.2.6
 *
 * @param int $user_id  ID of the user.
 * @param int $group_id ID of the group.
 * @return bool True on success, false on failure.
 */
function groups_remove_member($user_id, $group_id)
{
    if (!bp_is_item_admin()) {
        return false;
    }
    $member = new BP_Groups_Member($user_id, $group_id);
    /**
     * Fires before the removal of a member from a group.
     *
     * @since 1.2.6
     *
     * @param int $group_id ID of the group being removed from.
     * @param int $user_id  ID of the user being removed.
     */
    do_action('groups_remove_member', $group_id, $user_id);
    return $member->remove();
}
開發者ID:CompositeUK,項目名稱:clone.BuddyPress,代碼行數:26,代碼來源:bp-groups-functions.php

示例4: groups_remove_member

function groups_remove_member($user_id, $group_id)
{
    global $bp;
    if (!$bp->is_item_admin) {
        return false;
    }
    $member = new BP_Groups_Member($user_id, $group_id);
    do_action('groups_remove_member', $group_id, $user_id);
    return $member->remove();
}
開發者ID:nxtclass,項目名稱:NXTClass-Plugin,代碼行數:10,代碼來源:bp-groups-functions.php

示例5: test_cache_should_be_invalidated_on_group_remove

 /**
  * @group cache
  */
 public function test_cache_should_be_invalidated_on_group_remove()
 {
     // Populate cache.
     $g1 = bp_get_user_groups(self::$user);
     $m = new BP_Groups_Member(self::$user, self::$groups[1]);
     $m->remove();
     $expected = array(self::$groups[0]);
     $found = bp_get_user_groups(self::$user);
     $this->assertEqualSets($expected, array_keys($found));
 }
開發者ID:CompositeUK,項目名稱:clone.BuddyPress,代碼行數:13,代碼來源:bpGetUserGroups.php


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