auto_core_update_send_email

Filters whether to send an email following an automatic background core update.

Description

apply_filters( 'auto_core_update_send_email', (bool) $true, (string) $type, (object) $core_update, (mixed) $result ); 

Parameters (4)

0. $true (bool) => true
Whether to send the email. Default true.
1. $type (string)
The type of email to send. Can be one of success,, fail., critical.
2. $core_update (object)
The update offer that was attempted.
3. $result (mixed)
The result for the core update. Can be WP_Error.

Usage

To run the hook, copy the example below.
  1. $true = apply_filters( 'auto_core_update_send_email', $true, $type, $core_update, $result ); 
  2.  
  3. if ( !empty( $true ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the auto_core_update_send_email callback 
  2. function filter_auto_core_update_send_email( $true, $type, $core_update, $result ) { 
  3. // make filter magic happen here... 
  4. return $true
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'auto_core_update_send_email', 'filter_auto_core_update_send_email', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'auto_core_update_send_email', 'filter_auto_core_update_send_email', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/class-wp-automatic-updater.php  
  1. if ( 'manual' !== $type && ! apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result ) )