BP_Invitation::delete( array $args = array() )

Delete invitations.

Description

See also

Parameters

$args

(Optional) Associative array of columns/values, to determine which rows should be deleted. Of the format array( 'item_id' => 7, 'class' => 'BP_Groups_Invitation_Manager', ).

Default value: array()

Return

(int|bool) Number of rows deleted on success, false on failure.

Source

File: bp-core/classes/class-bp-invitation.php

	public static function delete( $args = array() ) {
		$where = self::get_query_clauses( $args );

		/**
		 * Fires before an invitation is deleted.
		 *
		 * @since BuddyBoss 1.3.5
		 *
		 *
		 * @param array $args Characteristics of the invitations to be deleted.
		 */
		do_action( 'bp_invitation_before_delete', $args );

		// Clear matching items from the cache.
		$cache_args = $args;
		$cache_args['fields'] = 'ids';
		$maybe_cached_ids = self::get( $cache_args );
		foreach ( $maybe_cached_ids as $invite_id ) {
			wp_cache_delete( $invite_id, 'bp_invitations' );
		}

		$retval = self::_delete( $where['data'], $where['format'] );

		/**
		 * Fires after an invitation is deleted.
		 *
		 * @since BuddyPress 5.0.0
		 *
		 * @param array $args Characteristics of the invitations just deleted.
		 */
		do_action( 'bp_invitation_after_delete', $args );

		return $retval;
	}

Changelog

Changelog
Version Description
BuddyBoss 1.3.5 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.