ActionScheduler_wpPostStore::fetch_action
Fetch actions.
Method of the class: ActionScheduler_wpPostStore{}
Hooks from the method
Returns
Object.
Usage
$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore(); $ActionScheduler_wpPostStore->fetch_action( $action_id );
- $action_id(int) (required)
- Action ID.
ActionScheduler_wpPostStore::fetch_action() ActionScheduler wpPostStore::fetch action code WC 10.3.6
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;
}