auto_core_update_send_email
Filter HookDescription
Filters whether to send an email following an automatic background core update.Hook Information
File Location |
wp-admin/includes/class-wp-automatic-updater.php
View on GitHub
|
Hook Type | Filter |
Line Number | 935 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$send
|
Whether to send the email. Default true. |
string
|
$type
|
The type of email to send. Can be one of 'success', 'fail', '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_send_email
add_filter('auto_core_update_send_email', 'my_custom_filter', 10, 4);
function my_custom_filter($send, $type, $core_update, $result) {
// Your custom filtering logic here
return $send;
}
Source Code Context
wp-admin/includes/class-wp-automatic-updater.php:935
- How this hook is used in WordPress core
<?php
930 * @param string $type The type of email to send. Can be one of
931 * 'success', 'fail', 'critical'.
932 * @param object $core_update The update offer that was attempted.
933 * @param mixed $result The result for the core update. Can be WP_Error.
934 */
935 if ( 'manual' !== $type && ! apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result ) ) {
936 return;
937 }
938
939 $admin_user = get_user_by( 'email', get_site_option( 'admin_email' ) );
940
PHP Documentation
<?php
/**
* Filters whether to send an email following an automatic background core update.
*
* @since 3.7.0
*
* @param bool $send Whether to send the email. Default true.
* @param string $type The type of email to send. Can be one of
* 'success', 'fail', '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.