BP_Group_Export::process_erase( $user,  $page, bool $email_address )

Delete member created groups.

Description

Parameters

$user

(Required)

$page

(Required)

$email_address

(Required)

Return

(array)

Source

File: bp-core/gdpr/class-bp-group-export.php

179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
function process_erase( $user, $page, $email_address ) {
 
    global $wpdb, $bp;
 
    if ( ! $user || is_wp_error( $user ) ) {
        return $this->response_erase( array(), true );
    }
 
    $number         = $this->items_per_batch;
    $page           = (int) $page;
    $items_removed  = true;
    $items_retained = false;
 
    add_action( 'groups_delete_group', array( $this, 'additional_group_items_delete' ) );
 
    // Remove Group Data for User.
    groups_remove_data_for_user( $user->ID );
 
    $group_table = $bp->groups->table_name_members;
 
    // Delete Invites.
    $wpdb->query( $wpdb->prepare( "DELETE FROM {$group_table} WHERE inviter_id=%d", $user->ID ) );
 
    $done = true;
 
    return $this->response_erase( $items_removed, $done, array(), $items_retained );
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.