Skip to content

Instantly share code, notes, and snippets.

@mommaroodles
Forked from nacin/auto-update.php
Created November 11, 2013 09:31
Show Gist options
  • Save mommaroodles/7410480 to your computer and use it in GitHub Desktop.
Save mommaroodles/7410480 to your computer and use it in GitHub Desktop.
<?php
// Add this as a mu-plugin.
if ( isset( $_GET['wp_maybe_auto_update'] ) ) {
add_filter( 'automatic_updates_is_vcs_checkout', '__return_false' );
add_action( 'template_redirect', function() {
$time = date( 'r' );
echo "Starting... $time<br />";
delete_site_option( 'auto_core_update_failed' );
delete_option( 'auto_upgrader.lock' );
delete_site_transient( 'update_core' );
wp_maybe_auto_update();
die( 'Done, check your email.' );
} );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment