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

Automattic\WooCommerce\Admin\API\Reports

TimeInterval::time_interval_id() public WC 1.0

Returns time interval id for the DateTime.

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

Хуков нет.

Возвращает

Строку.

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

$result = TimeInterval::time_interval_id( $time_interval, $datetime );
$time_interval(строка) (обязательный)
Time interval type (week, day, etc).
$datetime(DateTime) (обязательный)
Date & time.

Код TimeInterval::time_interval_id() WC 4.7.1

<?php
public static function time_interval_id( $time_interval, $datetime ) {
	// Whenever this is changed, double check method db_datetime_format to make sure they are in sync.
	$php_time_format_for = array(
		'hour'    => 'Y-m-d H',
		'day'     => 'Y-m-d',
		'week'    => 'o-W',
		'month'   => 'Y-m',
		'quarter' => 'Y-' . self::quarter( $datetime ),
		'year'    => 'Y',
	);

	// If the week does not begin on Monday.
	$first_day_of_week = absint( get_option( 'start_of_week' ) );

	if ( 'week' === $time_interval && 1 !== $first_day_of_week ) {
		$week_no = self::simple_week_number( $datetime, $first_day_of_week );
		$week_no = str_pad( $week_no, 2, '0', STR_PAD_LEFT );
		$year_no = $datetime->format( 'Y' );
		return "$year_no-$week_no";
	}

	return $datetime->format( $php_time_format_for[ $time_interval ] );
}