Created
December 22, 2015 17:57
-
-
Save BrendonKoz/368e30f561dafc7998c5 to your computer and use it in GitHub Desktop.
"MUST USE" plugin. Place in wp-content/mu-plugins to assure automatic theme & plugin updates are happening.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Theme and Plugin Auto-Update | |
Description: Forces automatic updates of installed plugins and themes. Be sure to have backups running! | |
Version: 1.0 | |
Author: Brendon Kozlowski | |
Author URI: http://www.bytekick.com | |
License: MIT | |
*/ | |
// Added for auto-updating plugins and themes, April 1, 2015 | |
// Codex Reference: https://codex.wordpress.org/Configuring_Automatic_Background_Updates | |
add_filter( 'auto_update_plugin', '__return_true' ); | |
add_filter( 'auto_update_theme', '__return_true' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By creating this as a must-use plugin (note: mu-plugins folder must be manually created if not already existing), any theme or plugin updates that this might've been included in otherwise would not cause these filters to be overridden. (Most docs suggest placing these filters in a must-use plugin, or in a theme's functions.php file; but since we want to allow updates to themes, it's possible they'd be overwritten).