Filter hook 'send_core_update_notification_email'

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

View Source

send_core_update_notification_email

Filter Hook
Description
Filters whether to notify the site administrator of a new core update. By default, administrators are notified when the update offer received from WordPress.org sets a particular flag. This allows some discretion in if and when to notify. This filter is only evaluated once per release. If the same email address was already notified of the same new version, WordPress won't repeatedly email the administrator. This filter is also used on about.php to check if a plugin has disabled these notifications.

Hook Information

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

Hook Parameters

Type Name Description
bool $notify Whether the site administrator is notified.
object $item The update offer.

Usage Examples

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

function my_custom_filter($notify, $item) {
    // Your custom filtering logic here
    return $notify;
}

Source Code Context

wp-admin/includes/class-wp-automatic-updater.php:345 - How this hook is used in WordPress core
<?php
 340  		 * @since 3.7.0
 341  		 *
 342  		 * @param bool   $notify Whether the site administrator is notified.
 343  		 * @param object $item   The update offer.
 344  		 */
 345  		if ( ! apply_filters( 'send_core_update_notification_email', $notify, $item ) ) {
 346  			return false;
 347  		}
 348  
 349  		$this->send_email( 'manual', $item );
 350  		return true;

PHP Documentation

<?php
/**
		 * Filters whether to notify the site administrator of a new core update.
		 *
		 * By default, administrators are notified when the update offer received
		 * from WordPress.org sets a particular flag. This allows some discretion
		 * in if and when to notify.
		 *
		 * This filter is only evaluated once per release. If the same email address
		 * was already notified of the same new version, WordPress won't repeatedly
		 * email the administrator.
		 *
		 * This filter is also used on about.php to check if a plugin has disabled
		 * these notifications.
		 *
		 * @since 3.7.0
		 *
		 * @param bool   $notify Whether the site administrator is notified.
		 * @param object $item   The update offer.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/class-wp-automatic-updater.php
Related Hooks

Related hooks will be displayed here in future updates.