Skip to content

Instantly share code, notes, and snippets.

@kkrieger85
Created April 29, 2016 07:34
Show Gist options
  • Save kkrieger85/5a7cc8eb683350c20b8dd13da0c83234 to your computer and use it in GitHub Desktop.
Save kkrieger85/5a7cc8eb683350c20b8dd13da0c83234 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: EnableAutoUpdates
* Plugin URI: ---
* Description: *Enable autoupdates for major_core_update, minor_core_updates, plugin_update, theme_updates *Sends E-Mail for success, fail, critical results. *For more information, see <a href="http://codex.wordpress.org/Configuring_Automatic_Background_Updates">Wordpress-Codex</a> and <a href="http://wordpress.stackexchange.com/questions/120081/how-do-i-configure-automatic-updates-in-wordpress-3-7">Article on wordpress.stackexchange.com </a>
* Version: 0.0.1
* Author: Kevin Krieger
* Author URI: http://kkrieger.de
* Text Domain: mytextdomain
* License: GPL2
*/
// Enable major version updates:
add_filter( 'allow_major_auto_core_updates', '__return_true' );
// Enable minor updates
add_filter( 'allow_minor_auto_core_updates', '__return_true' );
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );
// Enable update emails
/* @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.
*/
apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result );
/**
apply_filters( 'auto_core_update_send_email', true, 'success', $core_update, $result );
apply_filters( 'auto_core_update_send_email', true, 'fail', $core_update, $result );
apply_filters( 'auto_core_update_send_email', true, 'critical', $core_update, $result );
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment