Page MenuHomeDevCentral
Paste P251

Configure automatic updates for Wordpress
ActivePublic

Authored by dereckson on Feb 6 2017, 12:07.
<?php
/**
* Plugin Name: Extra settings for dereckson.be
* Description: Adds extra settings to this WordPress installation
* Version: 0.1
* Author: Dereckson
* Author URI: https://www.dereckson.be/
* License: PD
*/
add_filter('automatic_updates_send_debug_email', '__return_false');
add_filter('auto_core_update_send_email', 'auto_core_update_send_email_callback');
add_filter('automatic_updates_is_vcs_checkout', '__return_false', 1);
/**
* Determines when to send en e-mail fore core update (only on failure)
*
* @param bool $send Whether to send the email. Default true.
* @param string $type The type of email to send.
* Can be one of 'success', 'fail', 'critical'.
* @param object $core_update The update offer that was attempted.
* @param mixed $result The result for the core update. Can be WP_Error.
*
* @return bool true if a mail should be sent; otherwise, false.
*/
function auto_core_update_send_email_callback ($send, $type, $core_update, $result) {
return $send && ($type !== 'success');
}