ActionScheduler_wpPostStore::get_post_status_by_action_status
Get post status by action status.
Метод класса: ActionScheduler_wpPostStore{}
Хуков нет.
Возвращает
Строку.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_post_status_by_action_status( $action_status );
- $action_status(строка) (обязательный)
- Action status.
Код ActionScheduler_wpPostStore::get_post_status_by_action_status() ActionScheduler wpPostStore::get post status by action status WC 10.9.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;
}