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