bp_groups_pending_sent_invitations_personal_data_exporter( string $email_address, int $page )
Finds and exports data on pending group invitations sent by a user associated with an email address.
Description Description
Parameters Parameters
- $email_address
-
(Required) The user's email address.
- $page
-
(Required) Batch number.
Return Return
(array) An array of personal data.
Source Source
File: bp-groups/bp-groups-functions.php
function bp_groups_pending_sent_invitations_personal_data_exporter( $email_address, $page ) { $number = 20; $email_address = trim( $email_address ); $data_to_export = array(); $user = get_user_by( 'email', $email_address ); if ( ! $user ) { return array( 'data' => array(), 'done' => true, ); } $invitations = groups_get_invites( array( 'inviter_id' => $user->ID, 'page' => $page, 'per_page' => $number, ) ); foreach ( $invitations as $invitation ) { $group = groups_get_group( $invitation->item_id ); $item_data = array( array( 'name' => __( 'Group Name', 'buddypress' ), 'value' => bp_get_group_name( $group ), ), array( 'name' => __( 'Group URL', 'buddypress' ), 'value' => bp_get_group_permalink( $group ), ), array( 'name' => __( 'Sent To', 'buddypress' ), 'value' => bp_core_get_userlink( $invitation->user_id ), ), array( 'name' => __( 'Date Sent', 'buddypress' ), 'value' => $invitation->date_modified, ), ); $data_to_export[] = array( 'group_id' => 'bp_groups_pending_sent_invitations', 'group_label' => __( 'Pending Group Invitations (Sent)', 'buddypress' ), 'item_id' => "bp-group-pending-sent-invitation-{$group->id}", 'data' => $item_data, ); } // Tell core if we have more items to process. $done = count( $invitations ) < $number; return array( 'data' => $data_to_export, 'done' => $done, ); }
Changelog Changelog
Version | Description |
---|---|
4.0.0 | Introduced. |