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