ActionScheduler_wpPostStore::get_action_status_by_post_status()protectedWC 1.0

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() WC 8.7.0

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;
}