Automattic\WooCommerce\Internal\Admin\Settings

Utils::order_map_normalizepublic staticWC 1.0

Normalize an order map.

Sort the order map by the order and ensure the order values start from 0 and are consecutive.

Method of the class: Utils{}

No Hooks.

Returns

Array. The normalized order map.

Usage

$result = Utils::order_map_normalize( $order_map ): array;
$order_map(array) (required)
The order map.

Utils::order_map_normalize() code WC 9.8.5

public static function order_map_normalize( array $order_map ): array {
	asort( $order_map );

	return array_flip( array_keys( $order_map ) );
}