Filter hook 'auto_plugin_theme_update_email'

in WP Core File wp-admin/includes/class-wp-automatic-updater.php at line 1541

View Source

auto_plugin_theme_update_email

Filter Hook
Description
Filters the email sent following an automatic background update for plugins and themes. can be returned, as handled by wp_mail(). }

Hook Information

File Location wp-admin/includes/class-wp-automatic-updater.php View on GitHub
Hook Type Filter
Line Number 1541

Hook Parameters

Type Name Description
array $email { Array of email arguments that will be passed to wp_mail().
string $type The type of email being sent. Can be one of 'success', 'fail', 'mixed'.
array $successful_updates A list of updates that succeeded.
array $failed_updates A list of updates that failed.

Usage Examples

Basic Usage
<?php
// Hook into auto_plugin_theme_update_email
add_filter('auto_plugin_theme_update_email', 'my_custom_filter', 10, 4);

function my_custom_filter($email, $type, $successful_updates, $failed_updates) {
    // Your custom filtering logic here
    return $email;
}

Source Code Context

wp-admin/includes/class-wp-automatic-updater.php:1541 - How this hook is used in WordPress core
<?php
1536  		 * }
1537  		 * @param string $type               The type of email being sent. Can be one of 'success', 'fail', 'mixed'.
1538  		 * @param array  $successful_updates A list of updates that succeeded.
1539  		 * @param array  $failed_updates     A list of updates that failed.
1540  		 */
1541  		$email = apply_filters( 'auto_plugin_theme_update_email', $email, $type, $successful_updates, $failed_updates );
1542  
1543  		$result = wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
1544  
1545  		if ( $result ) {
1546  			update_option( 'auto_plugin_theme_update_emails', $past_failure_emails );

PHP Documentation

<?php
/**
		 * Filters the email sent following an automatic background update for plugins and themes.
		 *
		 * @since 5.5.0
		 *
		 * @param array  $email {
		 *     Array of email arguments that will be passed to wp_mail().
		 *
		 *     @type string $to      The email recipient. An array of emails
		 *                           can be returned, as handled by wp_mail().
		 *     @type string $subject The email's subject.
		 *     @type string $body    The email message body.
		 *     @type string $headers Any email headers, defaults to no headers.
		 * }
		 * @param string $type               The type of email being sent. Can be one of 'success', 'fail', 'mixed'.
		 * @param array  $successful_updates A list of updates that succeeded.
		 * @param array  $failed_updates     A list of updates that failed.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-admin/includes/class-wp-automatic-updater.php
Related Hooks

Related hooks will be displayed here in future updates.