bp_invites_bulk_action_handler( $redirect,  $doaction,  $object_ids )

Bulk revoke invitations.

Description

Parameters

$redirect

(Required)

$doaction

(Required)

$object_ids

(Required)

Return

(string)

Source

File: bp-invites/bp-invites-admin.php

function bp_invites_bulk_action_handler( $redirect, $doaction, $object_ids ) {

	$redirect = remove_query_arg( array( 'revoke_action' ), $redirect );

	if ( 'revoke_action' === $doaction ) {

		foreach ( $object_ids as $post_id ) {

			if ( isset( $post_id ) && '' !== $post_id ) {
				wp_delete_post( $post_id, true );
			}

		}

		// do not forget to add query args to URL because we will show notices later
		$redirect = add_query_arg(
			'revoke_action',
			count( $object_ids ), // parameter value - how much posts have been affected
			$redirect );

	}

	return $redirect;
}

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.