ActionScheduler_wpPostStore::fetch_action()publicWC 1.0

Fetch actions.

Method of the class: ActionScheduler_wpPostStore{}

Hooks from the method

Return

Object.

Usage

$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore();
$ActionScheduler_wpPostStore->fetch_action( $action_id );
$action_id(int) (required)
Action ID.

ActionScheduler_wpPostStore::fetch_action() code WC 9.4.2

public function fetch_action( $action_id ) {
	$post = $this->get_post( $action_id );
	if ( empty( $post ) || self::POST_TYPE !== $post->post_type ) {
		return $this->get_null_action();
	}

	try {
		$action = $this->make_action_from_post( $post );
	} catch ( ActionScheduler_InvalidActionException $exception ) {
		do_action( 'action_scheduler_failed_fetch_action', $post->ID, $exception );
		return $this->get_null_action();
	}

	return $action;
}