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

WP_Site_Health::get_test_php_default_timezone() public WP 5.3.1

Test if the PHP default timezone is set to UTC.

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

Хуков нет.

Возвращает

Массив. The test results.

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

$WP_Site_Health = new WP_Site_Health();
$WP_Site_Health->get_test_php_default_timezone();

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

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

Код WP Site Health::get test php default timezone: wp-admin/includes/class-wp-site-health.php WP 5.5.1

<?php
public function get_test_php_default_timezone() {
	$result = array(
		'label'       => __( 'PHP default timezone is valid' ),
		'status'      => 'good',
		'badge'       => array(
			'label' => __( 'Performance' ),
			'color' => 'blue',
		),
		'description' => sprintf(
			'<p>%s</p>',
			__( 'PHP default timezone was configured by WordPress on loading. This is necessary for correct calculations of dates and times.' )
		),
		'actions'     => '',
		'test'        => 'php_default_timezone',
	);

	if ( 'UTC' !== date_default_timezone_get() ) {
		$result['status'] = 'critical';

		$result['label'] = __( 'PHP default timezone is invalid' );

		$result['description'] = sprintf(
			'<p>%s</p>',
			sprintf(
				/* translators: %s: date_default_timezone_set() */
				__( 'PHP default timezone was changed after WordPress loading by a %s function call. This interferes with correct calculations of dates and times.' ),
				'<code>date_default_timezone_set()</code>'
			)
		);
	}

	return $result;
}