ActionScheduler_wpPostStore::create_post_array
Create post array.
Метод класса: ActionScheduler_wpPostStore{}
Хуков нет.
Возвращает
Массив. Returns an array of post data.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->create_post_array( $action, ?DateTime $scheduled_date );
- $action(ActionScheduler_Action) (обязательный)
- Scheduled Action.
- ?DateTime $scheduled_date
- .
По умолчанию: null
Код ActionScheduler_wpPostStore::create_post_array() ActionScheduler wpPostStore::create post array WC 10.3.5
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;
}