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