ActionScheduler_wpPostStore::create_post_array()protectedWC 1.0

Create post array.

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

Хуков нет.

Возвращает

Массив. Returns an array of post data.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->create_post_array( $action, $scheduled_date );
$action(ActionScheduler_Action) (обязательный)
Scheduled Action.
$scheduled_date(DateTime)
Scheduled Date.
По умолчанию: null

Код ActionScheduler_wpPostStore::create_post_array() WC 8.7.0

protected function create_post_array( ActionScheduler_Action $action, DateTime $scheduled_date = null ) {
	$post = array(
		'post_type'     => self::POST_TYPE,
		'post_title'    => $action->get_hook(),
		'post_content'  => wp_json_encode( $action->get_args() ),
		'post_status'   => ( $action->is_finished() ? 'publish' : 'pending' ),
		'post_date_gmt' => $this->get_scheduled_date_string( $action, $scheduled_date ),
		'post_date'     => $this->get_scheduled_date_string_local( $action, $scheduled_date ),
	);
	return $post;
}