Skip to content

Instantly share code, notes, and snippets.

@BrendonKoz
Created December 22, 2015 17:57
Show Gist options
  • Save BrendonKoz/368e30f561dafc7998c5 to your computer and use it in GitHub Desktop.
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.
<?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' );
@BrendonKoz
Copy link
Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment