LLMS_REST_Webhook::should_deliver( array $args )

Determines if an originating action qualifies for webhook delivery


Parameters Parameters

$args

(array) (Required) Numeric array of arguments from the originating hook.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/models/class-llms-rest-webhook.php

	protected function should_deliver( $args ) {

		$deliver = ( 'active' === $this->get( 'status' ) ) // Must be active.
			&& $this->is_valid_action( $args ) // Valid action.
			&& $this->is_valid_resource( $args ) // Valid resource.
			&& ! $this->is_already_processed( $args ); // Not already processed.

		/**
		 * Skip or hijack webhook delivery scheduling
		 *
		 * @param bool              $deliver Whether or not to deliver webhook delivery.
		 * @param LLMS_REST_Webhook $this    Webhook object.
		 * @param array             $args    Numeric array of arguments from the originating hook.
		 */
		return apply_filters( 'llms_rest_webhook_should_deliver', $deliver, $this, $args );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.1
[verison] Drop checking whether the webhook is pending in favor of a check on if is already processed within the current request. Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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