ActionScheduler_wpPostStore::create_post_array()
Create post array.
Method of the class: ActionScheduler_wpPostStore{}
No Hooks.
Return
Array
. Returns an array of post data.
Usage
// protected - for code of main (parent) or child class $result = $this->create_post_array( $action, $scheduled_date );
- $action(ActionScheduler_Action) (required)
- Scheduled Action.
- $scheduled_date(DateTime)
- Scheduled Date.
Default: null
ActionScheduler_wpPostStore::create_post_array() ActionScheduler wpPostStore::create post array code WC 9.3.3
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; }