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

WP_Automatic_Updater::after_plugin_theme_update() protected WP 5.5.0

If we tried to perform plugin or theme updates, check if we should send an email.

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

Возвращает

Null. Ничего.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->after_plugin_theme_update( $update_results );
$update_results(массив) (обязательный)
The results of update tasks.

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

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

Код WP_Automatic_Updater::after_plugin_theme_update() WP 5.5.1

wp-admin/includes/class-wp-automatic-updater.php
<?php
protected function after_plugin_theme_update( $update_results ) {
	$successful_updates = array();
	$failed_updates     = array();

	/**
	 * Filters whether to send an email following an automatic background plugin update.
	 *
	 * @since 5.5.0
	 * @since 5.5.1 Added the $update_results parameter.
	 *
	 * @param bool  $enabled        True if plugins notifications are enabled, false otherwise.
	 * @param array $update_results The results of plugins update tasks.
	 */
	$notifications_enabled = apply_filters( 'auto_plugin_update_send_email', true, $update_results['plugin'] );

	if ( ! empty( $update_results['plugin'] ) && $notifications_enabled ) {
		foreach ( $update_results['plugin'] as $update_result ) {
			if ( true === $update_result->result ) {
				$successful_updates['plugin'][] = $update_result;
			} else {
				$failed_updates['plugin'][] = $update_result;
			}
		}
	}

	/**
	 * Filters whether to send an email following an automatic background theme update.
	 *
	 * @since 5.5.0
	 * @since 5.5.1 Added the $update_results parameter.
	 *
	 * @param bool  $enabled True if notifications are enabled, false otherwise.
	 * @param array $update_results The results of theme update tasks.
	 */
	$notifications_enabled = apply_filters( 'auto_theme_update_send_email', true, $update_results['theme'] );

	if ( ! empty( $update_results['theme'] ) && $notifications_enabled ) {
		foreach ( $update_results['theme'] as $update_result ) {
			if ( true === $update_result->result ) {
				$successful_updates['theme'][] = $update_result;
			} else {
				$failed_updates['theme'][] = $update_result;
			}
		}
	}

	if ( empty( $successful_updates ) && empty( $failed_updates ) ) {
		return;
	}

	if ( empty( $failed_updates ) ) {
		$this->send_plugin_theme_email( 'success', $successful_updates, $failed_updates );
	} elseif ( empty( $successful_updates ) ) {
		$this->send_plugin_theme_email( 'fail', $successful_updates, $failed_updates );
	} else {
		$this->send_plugin_theme_email( 'mixed', $successful_updates, $failed_updates );
	}
}