Automattic\WooCommerce\Caches

OrderCountCacheService::get_prefixed_statusprivateWC 1.0

Get the prefixed status.

Method of the class: OrderCountCacheService{}

No Hooks.

Returns

String.

Usage

// private - for code of main (parent) class only
$result = $this->get_prefixed_status( $status );
$status(string) (required)
The status.

OrderCountCacheService::get_prefixed_status() code WC 10.7.0

private function get_prefixed_status( $status ) {
	$status = 'wc-' . $status;

	$special_statuses = array(
		'wc-' . OrderStatus::AUTO_DRAFT => OrderStatus::AUTO_DRAFT,
		'wc-' . OrderStatus::TRASH      => OrderStatus::TRASH,
	);

	if ( isset( $special_statuses[ $status ] ) ) {
		return $special_statuses[ $status ];
	}

	return $status;
}