auto_plugin_update_send_email
Filter HookDescription
Filters whether to send an email following an automatic background plugin update.Hook Information
File Location |
wp-admin/includes/class-wp-automatic-updater.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1177 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$enabled
|
True if plugin update notifications are enabled, false otherwise. |
array
|
$update_results
|
The results of plugins update tasks. |
Usage Examples
Basic Usage
<?php
// Hook into auto_plugin_update_send_email
add_filter('auto_plugin_update_send_email', 'my_custom_filter', 10, 2);
function my_custom_filter($enabled, $update_results) {
// Your custom filtering logic here
return $enabled;
}
Source Code Context
wp-admin/includes/class-wp-automatic-updater.php:1177
- How this hook is used in WordPress core
<?php
1172 * @since 5.5.1 Added the `$update_results` parameter.
1173 *
1174 * @param bool $enabled True if plugin update notifications are enabled, false otherwise.
1175 * @param array $update_results The results of plugins update tasks.
1176 */
1177 $notifications_enabled = apply_filters( 'auto_plugin_update_send_email', true, $update_results['plugin'] );
1178
1179 if ( $notifications_enabled ) {
1180 foreach ( $update_results['plugin'] as $update_result ) {
1181 if ( true === $update_result->result ) {
1182 $successful_updates['plugin'][] = $update_result;
PHP Documentation
<?php
/**
* Filters whether to send an email following an automatic background plugin update.
*
* @since 5.5.0
* @since 5.5.1 Added the `$update_results` parameter.
*
* @param bool $enabled True if plugin update notifications are enabled, false otherwise.
* @param array $update_results The results of plugins update tasks.
*/
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.