' . __( 'This is the admin view of a user's profile.', 'buddypress' ) . '
' .
'' . __( 'In the main column, you can edit the fields of the user's extended profile.', 'buddypress' ) . '
' .
'' . __( 'In the right-hand column, you can update the user's status, delete the user's avatar, and view recent statistics.', 'buddypress' ) . '
'
) );
// Help panel - sidebar links.
get_current_screen()->set_help_sidebar(
'' . __( 'This is the administration screen for pending accounts on your site.', 'buddypress' ) . '
' .
'' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress' ) . '
' .
'' . __( 'You can reorder the list of your pending accounts by clicking on the Username, Email or Registered column headers.', 'buddypress' ) . '
' .
'' . __( 'Using the search form, you can find pending accounts more easily. The Username and Email fields will be included in the search.', 'buddypress' ) . '
'
) );
$signup_help_content = '' . esc_html__( 'Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:', 'buddypress' ) . '
';
if ( bp_get_membership_requests_required() ) {
$signup_help_content .= '' . esc_html__( 'By clicking on a Username you will be able to activate a pending account from the confirmation screen.', 'buddypress' ) . '
' .
'' . __( 'Bulk actions allow you to perform these 3 actions for the selected rows.', 'buddypress' ) . '
';
get_current_screen()->add_help_tab( array(
'id' => 'bp-signups-actions',
'title' => __( 'Actions', 'buddypress' ),
'content' => $signup_help_content
) );
// Help panel - sidebar links.
get_current_screen()->set_help_sidebar(
'
signups_display_errors();?>
signups_admin_manage( $doaction );
break;
default:
$this->signups_admin_index();
break;
}
}
/**
* This is the list of the Pending accounts (signups).
*
* @since 2.0.0
*
* @global $plugin_page
* @global $bp_members_signup_list_table
*/
public function signups_admin_index() {
global $plugin_page, $bp_members_signup_list_table;
$usersearch = ! empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
// Prepare the group items for display.
$bp_members_signup_list_table->prepare_items();
if ( is_network_admin() ) {
$form_url = network_admin_url( 'users.php' );
} else {
$form_url = bp_get_admin_url( 'users.php' );
}
$form_url = add_query_arg(
array(
'page' => 'bp-signups',
),
$form_url
);
$search_form_url = remove_query_arg(
array(
'action',
'deleted',
'notdeleted',
'error',
'updated',
'delete',
'activate',
'activated',
'notactivated',
'resend',
'resent',
'notresent',
'do_delete',
'do_activate',
'do_resend',
'action2',
'_wpnonce',
'signup_ids'
), $_SERVER['REQUEST_URI']
);
?>
' . __( 'Search results for “%s”', 'buddypress' ) . '', esc_html( $usersearch ) );
}
?>
views(); ?>
capability ) || empty( $action ) ) {
die( '-1' );
}
// Get the user IDs from the URL.
$ids = false;
if ( ! empty( $_POST['allsignups'] ) ) {
$ids = wp_parse_id_list( $_POST['allsignups'] );
} elseif ( ! empty( $_GET['signup_id'] ) ) {
$ids = absint( $_GET['signup_id'] );
}
if ( empty( $ids ) ) {
return false;
}
// Query for signups, and filter out those IDs that don't
// correspond to an actual signup.
$signups_query = BP_Signup::get( array(
'include' => $ids,
) );
$signups = $signups_query['signups'];
$signup_ids = wp_list_pluck( $signups, 'id' );
// Set up strings.
switch ( $action ) {
case 'delete' :
$header_text = __( 'Delete Pending Accounts', 'buddypress' );
if ( 1 == count( $signup_ids ) ) {
$helper_text = __( 'You are about to delete the following account:', 'buddypress' );
} else {
$helper_text = __( 'You are about to delete the following accounts:', 'buddypress' );
}
break;
case 'activate' :
$header_text = __( 'Activate Pending Accounts', 'buddypress' );
if ( 1 == count( $signup_ids ) ) {
$helper_text = __( 'You are about to activate the following account:', 'buddypress' );
} else {
$helper_text = __( 'You are about to activate the following accounts:', 'buddypress' );
}
break;
case 'resend' :
if ( bp_get_membership_requests_required() ) {
$header_text = __( 'Approve Membership Requests', 'buddypress' );
if ( 1 === count( $signup_ids ) ) {
$helper_text = __( 'You are about to send an approval email to the following user:', 'buddypress' );
} else {
$helper_text = __( 'You are about to send approval emails to the following users:', 'buddypress' );
}
} else {
$header_text = __( 'Resend Activation Emails', 'buddypress' );
if ( 1 === count( $signup_ids ) ) {
$helper_text = __( 'You are about to resend an activation email to the following account:', 'buddypress' );
} else {
$helper_text = __( 'You are about to resend an activation email to the following accounts:', 'buddypress' );
}
}
break;
}
// These arguments are added to all URLs.
$url_args = array( 'page' => 'bp-signups' );
// These arguments are only added when performing an action.
$action_args = array(
'action' => 'do_' . $action,
'signup_ids' => implode( ',', $signup_ids )
);
if ( is_network_admin() ) {
$base_url = network_admin_url( 'users.php' );
} else {
$base_url = bp_get_admin_url( 'users.php' );
}
$cancel_url = add_query_arg( $url_args, $base_url );
$action_url = wp_nonce_url(
add_query_arg(
array_merge( $url_args, $action_args ),
$base_url
),
'signups_' . $action
);
// Prefetch registration field data.
$fdata = array();
if ( bp_is_active( 'xprofile' ) && ( 'activate' == $action || ( 'resend' == $action && bp_get_membership_requests_required() ) ) ) {
$field_groups = bp_xprofile_get_groups( array(
'exclude_fields' => 1,
'update_meta_cache' => false,
'fetch_fields' => true,
) );
foreach( $field_groups as $fg ) {
foreach( $fg->fields as $f ) {
$fdata[ $f->id ] = $f->name;
}
}
}
?>
count_sent > 0 ) {
$last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent );
} else {
$last_notified = __( 'Not yet notified', 'buddypress' );
}
$profile_field_ids = array();
// Get all xprofile field IDs except field 1.
if ( ! empty( $signup->meta['profile_field_ids'] ) ) {
$profile_field_ids = array_flip( explode( ',', $signup->meta['profile_field_ids'] ) );
unset( $profile_field_ids[1] );
} ?>
-
user_login ) ?>
|
user_name ); ?> |
|
user_email ); ?> |
$noop ) :
$field_value = isset( $signup->meta[ "field_{$pid}" ] ) ? $signup->meta[ "field_{$pid}" ] : ''; ?>
|
|
recently_sent ) ) : ?>
users_type_change_notice();
// Bail if no users are specified or if this isn't a BuddyPress action.
if ( empty( $_REQUEST['users'] )
|| ( empty( $_REQUEST['bp_change_type'] ) && empty( $_REQUEST['bp_change_type2'] ) )
|| empty( $_REQUEST['bp_change_member_type'] )
) {
return;
}
// Bail if nonce check fails.
check_admin_referer( 'bp-bulk-users-change-type-' . bp_loggedin_user_id(), 'bp-bulk-users-change-type-nonce' );
// Bail if current user cannot promote users.
if ( ! bp_current_user_can( 'promote_users' ) ) {
return;
}
$new_type = '';
if ( ! empty( $_REQUEST['bp_change_type2'] ) ) {
$new_type = sanitize_text_field( $_REQUEST['bp_change_type2'] );
} elseif ( ! empty( $_REQUEST['bp_change_type'] ) ) {
$new_type = sanitize_text_field( $_REQUEST['bp_change_type'] );
}
// Check that the selected type actually exists.
if ( 'remove_member_type' != $new_type && null === bp_get_member_type_object( $new_type ) ) {
$error = true;
} else {
// Run through user ids.
$error = false;
foreach ( (array) $_REQUEST['users'] as $user_id ) {
$user_id = (int) $user_id;
// Get the old member types to check against.
$current_types = bp_get_member_type( $user_id, false );
if ( $current_types && 'remove_member_type' === $new_type ) {
$member_types = array();
} elseif ( ! $current_types || 1 !== count( $current_types ) || $new_type !== $current_types[0] ) {
// Set the new member type.
$member_types = array( $new_type );
}
if ( isset( $member_types ) ) {
$set = bp_set_member_type( $user_id, $member_types );
if ( false === $set || is_wp_error( $set ) ) {
$error = true;
}
unset( $member_types );
}
}
}
// If there were any errors, show the error message.
if ( $error ) {
$redirect = add_query_arg( array( 'updated' => 'member-type-change-error' ), wp_get_referer() );
} else {
$redirect = add_query_arg( array( 'updated' => 'member-type-change-success' ), wp_get_referer() );
}
wp_redirect( $redirect );
exit();
}
/**
* Display an admin notice upon member type bulk update.
*
* @since 2.7.0
*/
public function users_type_change_notice() {
$updated = isset( $_REQUEST['updated'] ) ? $_REQUEST['updated'] : false;
// Display feedback.
if ( $updated && in_array( $updated, array( 'member-type-change-error', 'member-type-change-success' ), true ) ) {
if ( 'member-type-change-error' === $updated ) {
$notice = __( 'There was an error while changing member type. Please try again.', 'buddypress' );
$type = 'error';
} else {
$notice = __( 'Member type was changed successfully.', 'buddypress' );
$type = 'updated';
}
bp_core_add_admin_notice( $notice, $type );
}
}
/**
* Add member type column to the WordPress admin users list table.
*
* @since 2.7.0
*
* @param array $columns Users table columns.
*
* @return array $columns
*/
public function users_table_add_type_column( $columns = array() ) {
$columns[ bp_get_member_type_tax_name() ] = _x( 'Member Type', 'Label for the WP users table member type column', 'buddypress' );
return $columns;
}
/**
* Return member's type for display in the WP admin users list table.
*
* @since 2.7.0
*
* @param string $retval
* @param string $column_name
* @param int $user_id
*
* @return string Member type as a link to filter all users.
*/
public function users_table_populate_type_cell( $retval = '', $column_name = '', $user_id = 0 ) {
// Only looking for member type column.
if ( bp_get_member_type_tax_name() !== $column_name ) {
return $retval;
}
// Get the member type.
$member_type = bp_get_member_type( $user_id, false );
// Build the Output.
if ( $member_type ) {
$member_types = array_filter( array_map( 'bp_get_member_type_object', $member_type ) );
if ( ! $member_types ) {
return $retval;
}
$type_links = array();
foreach ( $member_types as $type ) {
$url = add_query_arg( array( 'bp-member-type' => urlencode( $type->name ) ) );
$type_links[] = sprintf(
'
%2$s',
esc_url( $url ),
esc_html( $type->labels['singular_name'] )
);
}
$retval = implode( ', ', $type_links );
}
return $retval;
}
/**
* Filter WP Admin users list table to include users of the specified type.
*
* @param WP_Query $query
*
* @since 2.7.0
*/
public function users_table_filter_by_type( $query ) {
global $pagenow;
if ( is_admin() && 'users.php' === $pagenow && ! empty( $_REQUEST['bp-member-type'] ) ) {
$type_slug = sanitize_text_field( $_REQUEST['bp-member-type'] );
// Check that the type is registered.
if ( null == bp_get_member_type_object( $type_slug ) ) {
return;
}
// Get the list of users that are assigned to this member type.
$type = bp_get_term_by( 'slug', $type_slug, bp_get_member_type_tax_name() );
if ( empty( $type->term_id ) ) {
return;
}
$user_ids = bp_get_objects_in_term( $type->term_id, bp_get_member_type_tax_name() );
if ( $user_ids && ! is_wp_error( $user_ids ) ) {
$query->set( 'include', (array) $user_ids );
}
}
}
/**
* Formats a signup's xprofile field data for display.
*
* Operates recursively on arrays, which are then imploded with commas.
*
* @since 2.8.0
* @deprecated 10.0.0
*
* @param string|array $value Field value.
* @return string
*/
protected function format_xprofile_field_for_display( $value ) {
_deprecated_function( __METHOD__, '10.0.0', 'bp_members_admin_format_xprofile_field_for_display' );
return bp_members_admin_format_xprofile_field_for_display( $value );
}
/**
* Set up the signups admin page.
*
* Loaded before the page is rendered, this function does all initial
* setup, including: processing form requests, registering contextual
* help, and setting up screen options.
*
* @since 8.0.0
*
* @global $bp_members_invitations_list_table
*/
public function members_invitations_admin_load() {
global $bp_members_invitations_list_table;
// Build redirection URL.
$redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'activated', 'notactivated', 'deleted', 'notdeleted', 'resent', 'notresent', 'do_delete', 'do_resend', 'do_activate', '_wpnonce', 'signup_ids' ), $_SERVER['REQUEST_URI'] );
$doaction = bp_admin_list_table_current_bulk_action();
/**
* Fires at the start of the member invitations admin load.
*
* @since 8.0.0
*
* @param string $doaction Current bulk action being processed.
* @param array $_REQUEST Current $_REQUEST global.
*/
do_action( 'bp_members_invitations_admin_load', $doaction, $_REQUEST );
/**
* Filters the allowed actions for use in the user signups admin page.
*
* @since 8.0.0
*
* @param array $value Array of allowed actions to use.
*/
$allowed_actions = apply_filters( 'bp_members_invitations_admin_allowed_actions', array( 'do_delete', 'do_resend' ) );
// Prepare the display of the bulk invitation action screen.
if ( ! in_array( $doaction, $allowed_actions ) ) {
$bp_members_invitations_list_table = self::get_list_table_class( 'BP_Members_Invitations_List_Table', 'users' );
// The per_page screen option.
add_screen_option( 'per_page', array( 'label' => _x( 'Members Invitations', 'Members Invitations per page (screen options)', 'buddypress' ) ) );
get_current_screen()->add_help_tab( array(
'id' => 'bp-members-invitations-overview',
'title' => __( 'Overview', 'buddypress' ),
'content' =>
'
' . __( 'This is the administration screen for member invitations on your site.', 'buddypress' ) . '
' .
'
' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress' ) . '
' .
'
' . __( 'You can reorder the list of invitations by clicking on the Invitee, Inviter, Date Modified, Email Sent, or Accepted column headers.', 'buddypress' ) . '
' .
'
' . __( 'Using the search form, you can find specific invitations more easily. The Invitee Email field will be included in the search.', 'buddypress' ) . '
'
) );
get_current_screen()->add_help_tab( array(
'id' => 'bp-members-invitations-actions',
'title' => __( 'Actions', 'buddypress' ),
'content' =>
'
' . __( 'Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:', 'buddypress' ) . '
' .
'
- ' . __( '"Send" or "Resend" takes you to the confirmation screen before being able to send or resend the invitation email to the desired pending invitee.', 'buddypress' ) . '
' .
'- ' . __( '"Delete" allows you to delete an unsent or accepted invitation from your site; "Cancel" allows you to cancel a sent, but not yet accepted, invitation. You will be asked to confirm this deletion.', 'buddypress' ) . '
' .
'
' . __( 'Bulk actions allow you to perform these actions for the selected rows.', 'buddypress' ) . '
'
) );
// Help panel - sidebar links.
get_current_screen()->set_help_sidebar(
'
' . __( 'For more information:', 'buddypress' ) . '
' .
'
' . __( 'Support Forums', 'buddypress' ) . '
'
);
// Add accessible hidden headings and text for the Pending Users screen.
get_current_screen()->set_screen_reader_content( array(
/* translators: accessibility text */
'heading_views' => __( 'Filter invitations list', 'buddypress' ),
/* translators: accessibility text */
'heading_pagination' => __( 'Invitation list navigation', 'buddypress' ),
/* translators: accessibility text */
'heading_list' => __( 'Invitations list', 'buddypress' ),
) );
} else {
if ( empty( $_REQUEST['invite_ids' ] ) ) {
return;
}
$invite_ids = wp_parse_id_list( $_REQUEST['invite_ids' ] );
// Handle resent invitations.
if ( 'do_resend' == $doaction ) {
// Nonce check.
check_admin_referer( 'invitations_resend' );
$success = 0;
foreach ( $invite_ids as $invite_id ) {
if ( bp_members_invitation_resend_by_id( $invite_id ) ) {
$success++;
}
}
$query_arg = array( 'updated' => 'resent' );
if ( ! empty( $success ) ) {
$query_arg['resent'] = $success;
}
$not_sent = count( $invite_ids ) - $success;
if ( $not_sent > 0 ) {
$query_arg['notsent'] = $not_sent;
}
$redirect_to = add_query_arg( $query_arg, $redirect_to );
bp_core_redirect( $redirect_to );
// Handle invitation deletion.
} elseif ( 'do_delete' == $doaction ) {
// Nonce check.
check_admin_referer( 'invitations_delete' );
$success = 0;
foreach ( $invite_ids as $invite_id ) {
if ( bp_members_invitations_delete_by_id( $invite_id ) ) {
$success++;
}
}
$query_arg = array( 'updated' => 'deleted' );
if ( ! empty( $success ) ) {
$query_arg['deleted'] = $success;
}
$notdeleted = count( $invite_ids ) - $success;
if ( $notdeleted > 0 ) {
$query_arg['notdeleted'] = $notdeleted;
}
$redirect_to = add_query_arg( $query_arg, $redirect_to );
bp_core_redirect( $redirect_to );
// Plugins can update other stuff from here.
} else {
$this->redirect = $redirect_to;
/**
* Fires at end of member invitations admin load
* if doaction does not match any actions.
*
* @since 8.0.0
*
* @param string $doaction Current bulk action being processed.
* @param array $_REQUEST Current $_REQUEST global.
* @param string $redirect Determined redirect url to send user to.
*/
do_action( 'bp_members_admin_update_invitations', $doaction, $_REQUEST, $this->redirect );
bp_core_redirect( $this->redirect );
}
}
}
/**
* Get admin notice when viewing the invitations management page.
*
* @since 8.0.0
*
* @return array
*/
private function get_members_invitations_notice() {
// Setup empty notice for return value.
$notice = array();
// Updates.
if ( ! empty( $_REQUEST['updated'] ) ) {
switch ( $_REQUEST['updated'] ) {
case 'resent':
$notice = array(
'class' => 'updated',
'message' => ''
);
if ( ! empty( $_REQUEST['resent'] ) ) {
$resent = absint( $_REQUEST['resent'] );
$notice['message'] .= sprintf(
_nx(
/* translators: %s: number of invitation emails sent */
'%s invtitation email successfully sent! ', '%s invitation emails successfully sent! ',
$resent,
'members invitation resent',
'buddypress'
),
number_format_i18n( $resent )
);
}
if ( ! empty( $_REQUEST['notsent'] ) ) {
$notsent = absint( $_REQUEST['notsent'] );
$notice['message'] .= sprintf(
_nx(
/* translators: %s: number of unsent invitation emails */
'%s invitation email was not sent.', '%s invitation emails were not sent.',
$notsent,
'members invitation notsent',
'buddypress'
),
number_format_i18n( $notsent )
);
if ( empty( $_REQUEST['resent'] ) ) {
$notice['class'] = 'error';
}
}
break;
case 'deleted':
$notice = array(
'class' => 'updated',
'message' => ''
);
if ( ! empty( $_REQUEST['deleted'] ) ) {
$deleted = absint( $_REQUEST['deleted'] );
$notice['message'] .= sprintf(
_nx(
/* translators: %s: number of deleted invitations */
'%s invitation successfully deleted!', '%s invitations successfully deleted!',
$deleted,
'members invitation deleted',
'buddypress'
),
number_format_i18n( $deleted )
);
}
if ( ! empty( $_REQUEST['notdeleted'] ) ) {
$notdeleted = absint( $_REQUEST['notdeleted'] );
$notice['message'] .= sprintf(
_nx(
/* translators: %s: number of invitations that failed to be deleted */
'%s invitation was not deleted.', '%s invitations were not deleted.',
$notdeleted,
'members invitation notdeleted',
'buddypress'
),
number_format_i18n( $notdeleted )
);
if ( empty( $_REQUEST['deleted'] ) ) {
$notice['class'] = 'error';
}
}
break;
}
}
// Errors.
if ( ! empty( $_REQUEST['error'] ) ) {
switch ( $_REQUEST['error'] ) {
case 'do_resend':
$notice = array(
'class' => 'error',
'message' => esc_html__( 'There was a problem sending the invitation emails. Please try again.', 'buddypress' ),
);
break;
case 'do_delete':
$notice = array(
'class' => 'error',
'message' => esc_html__( 'There was a problem deleting invitations. Please try again.', 'buddypress' ),
);
break;
}
}
return $notice;
}
/**
* Member invitations admin page router.
*
* Depending on the context, display
* - the list of invitations,
* - or the delete confirmation screen,
* - or the "resend" email confirmation screen.
*
* Also prepare the admin notices.
*
* @since 8.0.0
*/
public function invitations_admin() {
$doaction = bp_admin_list_table_current_bulk_action();
// Prepare notices for admin.
$notice = $this->get_members_invitations_notice();
// Display notices.
if ( ! empty( $notice ) ) :
if ( 'updated' === $notice['class'] ) : ?>
invitations_admin_manage( $doaction );
break;
default:
$this->invitations_admin_index();
break;
}
}
/**
* This is the list of invitations.
*
* @since 8.0.0
*
* @global $plugin_page
* @global $bp_members_invitations_list_table
*/
public function invitations_admin_index() {
global $plugin_page, $bp_members_invitations_list_table;
$usersearch = ! empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
// Prepare the group items for display.
$bp_members_invitations_list_table->prepare_items();
if ( is_network_admin() ) {
$form_url = network_admin_url( 'admin.php' );
} else {
$form_url = bp_get_admin_url( 'tools.php' );
}
$form_url = add_query_arg(
array(
'page' => 'bp-members-invitations',
),
$form_url
);
$search_form_url = remove_query_arg(
array(
'action',
'deleted',
'notdeleted',
'error',
'updated',
'delete',
'activate',
'activated',
'notactivated',
'resend',
'resent',
'notresent',
'do_delete',
'do_activate',
'do_resend',
'action2',
'_wpnonce',
'invite_ids'
), $_SERVER['REQUEST_URI']
);
bp_core_admin_tabbed_screen_header( __( 'BuddyPress tools', 'buddypress' ), __( 'Manage Invitations', 'buddypress' ), 'tools' );
?>
' . __( 'Search results for “%s”', 'buddypress' ) . '', esc_html( $usersearch ) );
}
?>
views(); ?>
capability ) || empty( $action ) ) {
die( '-1' );
}
// Get the IDs from the URL.
$ids = false;
if ( ! empty( $_POST['invite_ids'] ) ) {
$ids = wp_parse_id_list( $_POST['invite_ids'] );
} elseif ( ! empty( $_GET['invite_id'] ) ) {
$ids = absint( $_GET['invite_id'] );
}
if ( empty( $ids ) ) {
return false;
}
// Check invite IDs and set up strings.
switch ( $action ) {
case 'delete' :
// Query for matching invites, and filter out bad IDs.
$args = array(
'id' => $ids,
'invite_sent' => 'all',
'accepted' => 'all',
);
$invites = bp_members_invitations_get_invites( $args );
$invite_ids = wp_list_pluck( $invites, 'id' );
$header_text = __( 'Delete Invitations', 'buddypress' );
if ( 0 === count( $invite_ids ) ) {
$helper_text = __( 'No invites were found, nothing to delete!', 'buddypress' );
} else {
$helper_text = _n( 'You are about to delete the following invitation:', 'You are about to delete the following invitations:', count( $invite_ids ), 'buddypress' );
}
break;
case 'resend' :
/**
* Query for matching invites, and filter out bad IDs
* or those that have already been accepted.
*/
$args = array(
'id' => $ids,
'invite_sent' => 'all',
'accepted' => 'pending',
);
$invites = bp_members_invitations_get_invites( $args );
$invite_ids = wp_list_pluck( $invites, 'id' );
$header_text = __( 'Resend Invitation Emails', 'buddypress' );
if ( 0 === count( $invite_ids ) ) {
$helper_text = __( 'No pending invites were found, nothing to resend!', 'buddypress' );
} else {
$helper_text = _n( 'You are about to resend an invitation email to the following address:', 'You are about to resend invitation emails to the following addresses:', count( $invite_ids ), 'buddypress' );
}
break;
}
// These arguments are added to all URLs.
$url_args = array( 'page' => 'bp-members-invitations' );
// These arguments are only added when performing an action.
$action_args = array(
'action' => 'do_' . $action,
'invite_ids' => implode( ',', $invite_ids )
);
if ( is_network_admin() ) {
$base_url = network_admin_url( 'admin.php' );
} else {
$base_url = bp_get_admin_url( 'tools.php' );
}
$cancel_url = add_query_arg( $url_args, $base_url );
$action_url = wp_nonce_url(
add_query_arg(
array_merge( $url_args, $action_args ),
$base_url
),
'invitations_' . $action
);
bp_core_admin_tabbed_screen_header( __( 'BuddyPress tools', 'buddypress' ), __( 'Manage Invitations', 'buddypress' ), 'tools' );
?>
invite_sent ) {
$last_notified = mysql2date( 'Y/m/d g:i:s a', $invite->date_modified );
} else {
$last_notified = __( 'Not yet notified', 'buddypress');
}
?>
-
invitee_email ) ?>
>