本文整理汇总了PHP中BP_Groups_Member::delete_all_for_user方法的典型用法代码示例。如果您正苦于以下问题:PHP BP_Groups_Member::delete_all_for_user方法的具体用法?PHP BP_Groups_Member::delete_all_for_user怎么用?PHP BP_Groups_Member::delete_all_for_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BP_Groups_Member
的用法示例。
在下文中一共展示了BP_Groups_Member::delete_all_for_user方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: groups_remove_data_for_user
/**
* Delete all group membership information for the specified user.
*
* @since 1.0.0
*
* @param int $user_id ID of the user.
*/
function groups_remove_data_for_user($user_id)
{
BP_Groups_Member::delete_all_for_user($user_id);
/**
* Fires after the deletion of all data for a user.
*
* @since 1.1.0
*
* @param int $user_id ID of the user whose data is being deleted.
*/
do_action('groups_remove_data_for_user', $user_id);
}
示例2: groups_remove_data_for_user
/**
* Delete all group membership information for the specified user.
*
* @since BuddyPress (1.0.0)
*
* @param int $user_id ID of the user.
*/
function groups_remove_data_for_user($user_id)
{
BP_Groups_Member::delete_all_for_user($user_id);
do_action('groups_remove_data_for_user', $user_id);
}
示例3: groups_remove_data_for_user
function groups_remove_data_for_user($user_id)
{
global $bp;
BP_Groups_Member::delete_all_for_user($user_id);
bp_core_delete_notifications_from_user($user_id, $bp->groups->id, 'new_membership_request');
do_action('groups_remove_data_for_user', $user_id);
}
示例4: wangguard_spam_all_data
function wangguard_spam_all_data($user_id)
{
global $wpdb, $bp;
$wpdb->query($wpdb->prepare("DELETE FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id));
friends_remove_data($user_id);
$group_ids = BP_Groups_Member::get_group_ids($user_id);
foreach ($group_ids['groups'] as $group_id) {
groups_update_groupmeta($group_id, 'total_member_count', groups_get_total_member_count($group_id) - 1);
// If current user is the creator of a group and is the sole admin, delete that group to avoid counts going out-of-sync
if (groups_is_user_admin($user_id, $group_id) && count(groups_get_group_admins($group_id)) < 2 && groups_is_user_creator($user_id, $group_id)) {
groups_delete_group($group_id);
}
}
return $wpdb->query($wpdb->prepare("DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d", $user_id));
BP_Groups_Member::delete_all_for_user($user_id);
}