LLMS_REST_Webhook::is_valid_post_action( int $post_id )

Determine if the current post-related action is valid for the webhook


Parameters Parameters

$post_id

(int) (Required) WP Post ID.


Top ↑

Return Return

(bool)


Top ↑

Source Source

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

	 *
	 * @since 1.0.0-beta.1
	 * @since 1.0.0-beta.11 Skipped autosaves and revisions.
	 *                      Implemented a new way to consider a resource as just created. Thanks WooCoommerce.
	 *
	 * @param array $args Numeric array of arguments from the originating hook.
	 * @return bool
	 */
	protected function is_valid_resource( $args ) {

		$resource = $this->get_resource();

		if ( in_array( $resource, LLMS_REST_API()->webhooks()->get_post_type_resources(), true ) ) {

			$post_resource = get_post( absint( $args[0] ) );

			// Ignore auto-drafts.

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.