auto_core_update_email
Filter HookDescription
Filters the email sent following an automatic background core update. 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 | 1147 |
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', 'manual', 'critical'. |
object
|
$core_update
|
The update offer that was attempted. |
mixed
|
$result
|
The result for the core update. Can be WP_Error. |
Usage Examples
Basic Usage
<?php
// Hook into auto_core_update_email
add_filter('auto_core_update_email', 'my_custom_filter', 10, 4);
function my_custom_filter($email, $type, $core_update, $result) {
// Your custom filtering logic here
return $email;
}
Source Code Context
wp-admin/includes/class-wp-automatic-updater.php:1147
- How this hook is used in WordPress core
<?php
1142 * @param string $type The type of email being sent. Can be one of
1143 * 'success', 'fail', 'manual', 'critical'.
1144 * @param object $core_update The update offer that was attempted.
1145 * @param mixed $result The result for the core update. Can be WP_Error.
1146 */
1147 $email = apply_filters( 'auto_core_update_email', $email, $type, $core_update, $result );
1148
1149 wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
1150
1151 if ( $switched_locale ) {
1152 restore_previous_locale();
PHP Documentation
<?php
/**
* Filters the email sent following an automatic background core update.
*
* @since 3.7.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', 'manual', 'critical'.
* @param object $core_update The update offer that was attempted.
* @param mixed $result The result for the core update. Can be WP_Error.
*/
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.