Skip to content

Instantly share code, notes, and snippets.

@afragen
Created August 24, 2022 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afragen/3681fa4932c773cb8f2a6e24dbc2db17 to your computer and use it in GitHub Desktop.
Save afragen/3681fa4932c773cb8f2a6e24dbc2db17 to your computer and use it in GitHub Desktop.
Allows one to mash the WP Crontrol 'Run now' link with abandon.
/**
* Trick `WP_Automatic_Updater` into thinking there is no existing lock.
*
* By default, the auto-updater will only run once every hour even if
* the cron job is manually fired. That makes it hard to run multiple tests
* in a short period of time.
*/
add_filter(
'option_auto_updater.lock',
function ($value) {
return 1;
}
);
delete_option('option_auto_updater.lock');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment