LLMS_REST_Webhook::ping()

Perform a test ping to the delivery url


Return Return

(true|WP_Error)


Top ↑

Source Source

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

			// Translators: %d = Response code.
			return new WP_Error( 'llms_rest_webhook_ping_not_200', sprintf( __( 'The delivery url returned the response code "%d".', 'lifterlms' ), absint( $res_code ) ) );
		}

		return true;

	}

	/**
	 * Determines if an originating action qualifies for webhook delivery
	 *
	 * @since 1.0.0-beta.1
	 * @since [verison] Removed the "is already processed" check since ActionScheduler prevents duplicates.
	 *
	 * @param array $args Numeric array of arguments from the originating hook.
	 * @return bool
	 */
	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.

		/**
		 * 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.
		 */

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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