Automattic\WooCommerce\Internal\Admin\Settings
Utils::order_map_add_at_order
Add an id to a specific order in an order map.
Method of the class: Utils{}
No Hooks.
Returns
Array. The updated order map. If the id is already in the order map, the order map is returned as is.
Usage
$result = Utils::order_map_add_at_order( $order_map, $id, $order ): array;
- $order_map(array) (required)
- The order map.
- $id(string) (required)
- The id to move.
- $order(int) (required)
- The order to move the id to.
Utils::order_map_add_at_order() Utils::order map add at order code WC 10.9.4
public static function order_map_add_at_order( array $order_map, string $id, int $order ): array {
// If the id is in the order map, return the order map as is.
if ( isset( $order_map[ $id ] ) ) {
return $order_map;
}
return self::order_map_place_at_order( $order_map, $id, $order );
}