ActionScheduler_wpPostStore::get_post_status_by_action_status
Get post status by action status.
Method of the class: ActionScheduler_wpPostStore{}
No Hooks.
Returns
String.
Usage
// protected - for code of main (parent) or child class $result = $this->get_post_status_by_action_status( $action_status );
- $action_status(string) (required)
- Action status.
ActionScheduler_wpPostStore::get_post_status_by_action_status() ActionScheduler wpPostStore::get post status by action status code WC 10.8.1
protected function get_post_status_by_action_status( $action_status ) {
switch ( $action_status ) {
case self::STATUS_COMPLETE:
$post_status = 'publish';
break;
case self::STATUS_CANCELED:
$post_status = 'trash';
break;
default:
if ( ! array_key_exists( $action_status, $this->get_status_labels() ) ) {
throw new InvalidArgumentException( sprintf( 'Invalid action status: "%s".', $action_status ) );
}
$post_status = $action_status;
break;
}
return $post_status;
}