mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Introduce a send_update_notification_email
which controls whether an update notification email is sent for background updates. This filter allows control over each of the update types (plugin, theme, translation) and compliments the automatic_updates_send_debug_email
and send_core_update_notification_email
filters.
Fixes #33932 Props ronalfy Built from https://develop.svn.wordpress.org/trunk@34543 git-svn-id: http://core.svn.wordpress.org/trunk@34507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4b467a2698
commit
c69ec5a19a
@ -3368,6 +3368,24 @@ class WP_Automatic_Updater {
|
|||||||
|
|
||||||
// Plugins, Themes, Translations
|
// Plugins, Themes, Translations
|
||||||
foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) {
|
foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter to control whether a notification email is sent to the site admin email address for
|
||||||
|
* plugin, theme, and translation updates.
|
||||||
|
*
|
||||||
|
* By default, this only has an effect when automatic background updates are enabled and a
|
||||||
|
* development version of WordPress is in use.
|
||||||
|
*
|
||||||
|
* @since 4.4.0
|
||||||
|
*
|
||||||
|
* @param bool $notify Whether the site administrator is notified.
|
||||||
|
* @param string $type The type of update. One of 'plugin', 'theme', or 'translation'.
|
||||||
|
* @param WP_Automatic_Updater $this The WP_Automatic_Updater instance.
|
||||||
|
*/
|
||||||
|
if ( ! apply_filters( 'send_update_notification_email', true, $type, $this ) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! isset( $this->update_results[ $type ] ) )
|
if ( ! isset( $this->update_results[ $type ] ) )
|
||||||
continue;
|
continue;
|
||||||
$success_items = wp_list_filter( $this->update_results[ $type ], array( 'result' => true ) );
|
$success_items = wp_list_filter( $this->update_results[ $type ], array( 'result' => true ) );
|
||||||
@ -3402,6 +3420,10 @@ class WP_Automatic_Updater {
|
|||||||
$body[] = '';
|
$body[] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( empty( $body ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
|
$site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
|
||||||
if ( $failures ) {
|
if ( $failures ) {
|
||||||
$body[] = trim( __(
|
$body[] = trim( __(
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-34542';
|
$wp_version = '4.4-alpha-34543';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user