WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Admin\API\Reports

TimeInterval::normalize_between_params() public WC 1.0

Normalize "_between" parameters to "_min" and "_max" for numeric values and "_after" and "*_before" for date values.

{} Это метод класса: TimeInterval{}

Хуков нет.

Возвращает

Массив. Normalized query values.

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

$result = TimeInterval::normalize_between_params( $request, $param_names, $is_date );
$request(массив) (обязательный)
Query params from REST API request.
$param_names(строка/массив) (обязательный)
One or more param names to handle. Should not include "_between" suffix.
$is_date(true/false) (обязательный)
Boolean if the param is date is related.

Код TimeInterval::normalize_between_params() WC 4.7.1

<?php
public static function normalize_between_params( $request, $param_names, $is_date ) {
	if ( ! is_array( $param_names ) ) {
		$param_names = array( $param_names );
	}

	$normalized = array();

	foreach ( $param_names as $param_name ) {
		if ( ! is_array( $request[ $param_name . '_between' ] ) ) {
			continue;
		}

		$range = $request[ $param_name . '_between' ];

		if ( 2 !== count( $range ) ) {
			continue;
		}

		$min = $is_date ? '_after' : '_min';
		$max = $is_date ? '_before' : '_max';

		if ( $range[0] < $range[1] ) {
			$normalized[ $param_name . $min ] = $range[0];
			$normalized[ $param_name . $max ] = $range[1];
		} else {
			$normalized[ $param_name . $min ] = $range[1];
			$normalized[ $param_name . $max ] = $range[0];
		}
	}

	return $normalized;
}