BP_Invitation::mark_accepted( int $id, array $args = array() )

Mark specific invitations as accepted by invitation ID.


Parameters Parameters

$id

(int) (Required) The ID of the invitation to mark as sent.

$args

(array) (Optional) Invitation characteristics used to override certain sending behaviors.

  • 'date_modified'
    (string) Modified time in 'Y-m-d h:i:s' format, GMT. Defaults to current time if not specified.

Default value: array()


Top ↑

Return Return

(int|bool) The number of rows updated, or false on error.


Source Source

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

	public static function mark_accepted( $id = 0, $args = array() ) {

		if ( ! $id ) {
			return false;
		}

		// Values to be updated.
		$update_args = array(
			'accepted'      => 'accepted',
			'date_modified' => bp_core_current_time(),
		);
		// Respect a specified `date-modified`.
		if ( ! empty( $args['date_modified'] ) ) {
			$update_args['date_modified'] = $args['date_modified'];
		}

		// WHERE clauses.
		$where_args = array(
			'id' => $id,
		);

		return self::update( $update_args, $where_args );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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