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

WP_Site_Health_Auto_Updates::test_if_failed_update() public WP 5.2.0

Check if automatic updates have tried to run, but failed, previously.

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

Хуков нет.

Возвращает

Массив/true/false. The test results. False if the auto-updates failed.

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

$WP_Site_Health_Auto_Updates = new WP_Site_Health_Auto_Updates();
$WP_Site_Health_Auto_Updates->test_if_failed_update();

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

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

Код WP_Site_Health_Auto_Updates::test_if_failed_update() WP 5.5.1

wp-admin/includes/class-wp-site-health-auto-updates.php
<?php
function test_if_failed_update() {
	$failed = get_site_option( 'auto_core_update_failed' );

	if ( ! $failed ) {
		return false;
	}

	if ( ! empty( $failed['critical'] ) ) {
		$description  = __( 'A previous automatic background update ended with a critical failure, so updates are now disabled.' );
		$description .= ' ' . __( 'You would have received an email because of this.' );
		$description .= ' ' . __( "When you've been able to update using the \"Update Now\" button on Dashboard > Updates, we'll clear this error for future update attempts." );
		$description .= ' ' . sprintf(
			/* translators: %s: Code of error shown. */
			__( 'The error code was %s.' ),
			'<code>' . $failed['error_code'] . '</code>'
		);
		return array(
			'description' => $description,
			'severity'    => 'warning',
		);
	}

	$description = __( 'A previous automatic background update could not occur.' );
	if ( empty( $failed['retry'] ) ) {
		$description .= ' ' . __( 'You would have received an email because of this.' );
	}

	$description .= ' ' . __( "We'll try again with the next release." );
	$description .= ' ' . sprintf(
		/* translators: %s: Code of error shown. */
		__( 'The error code was %s.' ),
		'<code>' . $failed['error_code'] . '</code>'
	);
	return array(
		'description' => $description,
		'severity'    => 'warning',
	);
}