Skip to content

Instantly share code, notes, and snippets.

@costdev
Last active June 18, 2024 06:24
Show Gist options
  • Save costdev/a6a50b492ce664c1365e1a5c6a7e8429 to your computer and use it in GitHub Desktop.
Save costdev/a6a50b492ce664c1365e1a5c6a7e8429 to your computer and use it in GitHub Desktop.
Force `core_updater.lock` option retrieval to fail.
<?php
/**
* Plugin Name: Force Core update failure.
* Description: Forces a Core update failure.
* Author: WordPress Core Contributors
* Author URI: https://make.wordpress.org/core
* License: GPLv2 or later
* Version: 1.0.0
*/
/*
* The value will be returned only when it is not `false`.
*
* The Core automatic update process requires a falsy value
* to consider the lock attempt a failure.
*/
add_filter( 'pre_option_core_updater.lock', '__return_null' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment