Automattic\WooCommerce\Utilities

OrderUtil::remove_status_prefix │ public static │ WC 9.2.0

Removes the 'wc-' prefix from status.

Метод класса: OrderUtil{}

Хуков нет.

Возвращает

string. The status without the prefix.

Использование

$result = OrderUtil::remove_status_prefix( $status ): string;
$status(строка) (обязательный)
The status to remove the prefix from.

Список изменений

С версии 9.2.0 Введена.

Код OrderUtil::remove_status_prefix() WC 11.1.2

public static function remove_status_prefix( string $status ): string {
	if ( strpos( $status, 'wc-' ) === 0 ) {
		$status = substr( $status, 3 );
	}

	return $status;
}