BP_Members_Invitations_List_Table::column_invitee_email( BP_Invitation $invite = null )

Markup for the checkbox used to select items for bulk actions.


Parameters Parameters

$invite

(BP_Invitation) (Optional) BP_Invitation object.

Default value: null


Source Source

File: bp-members/classes/class-bp-members-invitations-list-table.php

	public function column_invitee_email( $invite = null ) {
		echo esc_html( $invite->invitee_email );

		$actions = array();
		$tools_url = bp_get_admin_url( 'tools.php' );

		if ( is_network_admin() ) {
			$tools_url = network_admin_url( 'admin.php' );
		}

		// Resend action only if pending
		if ( ! $invite->accepted ) {
			// Resend invitation email link.
			$email_link = add_query_arg(
				array(
					'page'	    => 'bp-members-invitations',
					'invite_id' => $invite->id,
					'action'    => 'resend',
				),
				$tools_url
			);

			if ( ! $invite->invite_sent ) {
				$resend_label = __( 'Send', 'buddypress' );
			} else {
				$resend_label = __( 'Resend', 'buddypress' );
			}

			$actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), esc_html( $resend_label ) );
		}

		// Delete link. Could be cleanup or revoking the invitation.
		$delete_link = add_query_arg(
			array(
				'page'      => 'bp-members-invitations',
				'invite_id' => $invite->id,
				'action'    => 'delete',
			),
			$tools_url
		);

		// Two cases: unsent and accepted (cleanup), and pending (cancels invite).
		if ( ! $invite->invite_sent || $invite->accepted ) {
			$actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Delete', 'buddypress' ) );
		} else {
			$actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Cancel', 'buddypress' ) );
		}

		/**
		 * Filters the row actions for each invitation in list.
		 *
		 * @since 8.0.0
		 *
		 * @param array  $actions Array of actions and corresponding links.
		 * @param object $invite  The BP_Invitation.
		 */
		$actions = apply_filters( 'bp_members_invitations_management_row_actions', $actions, $invite );

		echo $this->row_actions( $actions );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.