Automattic\WooCommerce\Utilities

OrderUtil::remove_status_prefix()public staticWC 9.2.0

Removes the 'wc-' prefix from status.

Method of the class: OrderUtil{}

No Hooks.

Return

String. The status without the prefix.

Usage

$result = OrderUtil::remove_status_prefix( $status ): string;
$status(string) (required)
The status to remove the prefix from.

Changelog

Since 9.2.0 Introduced.

OrderUtil::remove_status_prefix() code WC 9.4.2

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

	return $status;
}