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

WP_Customize_Date_Time_Control::get_timezone_info() public WP 4.9.0

Get timezone info.

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

Хуков нет.

Возвращает

Массив. abbr and description.

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

$WP_Customize_Date_Time_Control = new WP_Customize_Date_Time_Control();
$WP_Customize_Date_Time_Control->get_timezone_info();

Список изменений

С версии 4.9.0 Введена.

Код WP_Customize_Date_Time_Control::get_timezone_info() WP 5.5.1

wp-includes/customize/class-wp-customize-date-time-control.php
<?php
public function get_timezone_info() {
	$tz_string     = get_option( 'timezone_string' );
	$timezone_info = array();

	if ( $tz_string ) {
		try {
			$tz = new DateTimezone( $tz_string );
		} catch ( Exception $e ) {
			$tz = '';
		}

		if ( $tz ) {
			$now                   = new DateTime( 'now', $tz );
			$formatted_gmt_offset  = $this->format_gmt_offset( $tz->getOffset( $now ) / 3600 );
			$tz_name               = str_replace( '_', ' ', $tz->getName() );
			$timezone_info['abbr'] = $now->format( 'T' );

			$timezone_info['description'] = sprintf(
				/* translators: 1: Timezone name, 2: Timezone abbreviation, 3: UTC abbreviation and offset, 4: UTC offset. */
				__( 'Your timezone is set to %1$s (%2$s), currently %3$s (Coordinated Universal Time %4$s).' ),
				$tz_name,
				'<abbr>' . $timezone_info['abbr'] . '</abbr>',
				'<abbr>UTC</abbr>' . $formatted_gmt_offset,
				$formatted_gmt_offset
			);
		} else {
			$timezone_info['description'] = '';
		}
	} else {
		$formatted_gmt_offset = $this->format_gmt_offset( intval( get_option( 'gmt_offset', 0 ) ) );

		$timezone_info['description'] = sprintf(
			/* translators: 1: UTC abbreviation and offset, 2: UTC offset. */
			__( 'Your timezone is set to %1$s (Coordinated Universal Time %2$s).' ),
			'<abbr>UTC</abbr>' . $formatted_gmt_offset,
			$formatted_gmt_offset
		);
	}

	return $timezone_info;
}