ActionScheduler_wpPostStore::make_action_from_post()protectedWC 1.0

Make action from post.

Метод класса: ActionScheduler_wpPostStore{}

Хуков нет.

Возвращает

WP_Post.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->make_action_from_post( $post );
$post(WP_Post) (обязательный)
Post object.

Код ActionScheduler_wpPostStore::make_action_from_post() WC 9.3.3

protected function make_action_from_post( $post ) {
	$hook = $post->post_title;

	$args = json_decode( $post->post_content, true );
	$this->validate_args( $args, $post->ID );

	$schedule = get_post_meta( $post->ID, self::SCHEDULE_META_KEY, true );
	$this->validate_schedule( $schedule, $post->ID );

	$group = wp_get_object_terms( $post->ID, self::GROUP_TAXONOMY, array( 'fields' => 'names' ) );
	$group = empty( $group ) ? '' : reset( $group );

	return ActionScheduler::factory()->get_stored_action( $this->get_action_status_by_post_status( $post->post_status ), $hook, $args, $schedule, $group );
}