auto_theme_update_send_email
Filter HookDescription
Filters whether to send an email following an automatic background theme update.Hook Information
File Location |
wp-admin/includes/class-wp-automatic-updater.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1200 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$enabled
|
True if theme update notifications are enabled, false otherwise. |
array
|
$update_results
|
The results of theme update tasks. |
Usage Examples
Basic Usage
<?php
// Hook into auto_theme_update_send_email
add_filter('auto_theme_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:1200
- How this hook is used in WordPress core
<?php
1195 * @since 5.5.1 Added the `$update_results` parameter.
1196 *
1197 * @param bool $enabled True if theme update notifications are enabled, false otherwise.
1198 * @param array $update_results The results of theme update tasks.
1199 */
1200 $notifications_enabled = apply_filters( 'auto_theme_update_send_email', true, $update_results['theme'] );
1201
1202 if ( $notifications_enabled ) {
1203 foreach ( $update_results['theme'] as $update_result ) {
1204 if ( true === $update_result->result ) {
1205 $successful_updates['theme'][] = $update_result;
PHP Documentation
<?php
/**
* Filters whether to send an email following an automatic background theme update.
*
* @since 5.5.0
* @since 5.5.1 Added the `$update_results` parameter.
*
* @param bool $enabled True if theme update notifications are enabled, false otherwise.
* @param array $update_results The results of theme 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.