function () { if ( file_exists( ABSPATH . 'wp-content/object-cache.php' ) && false !== strpos( file_get_contents( ABSPATH . 'wp-content/object-cache.php' ), 'WP_PLUGIN_CHECK_OBJECT_CACHE_DROPIN_VERSION' ) ) { unlink( ABSPATH . 'wp-content/object-cache.php' ); } }, ) ); /* * Add hook to set up the object-cache.php drop-in file. * * Runs after wp-config.php is loaded and thus ABSPATH is defined, * but before any plugins are actually loaded. */ WP_CLI::add_hook( 'after_wp_config_load', function () { if ( CLI_Runner::is_plugin_check() ) { if ( ! file_exists( ABSPATH . 'wp-content/object-cache.php' ) ) { if ( ! copy( __DIR__ . '/drop-ins/object-cache.copy.php', ABSPATH . 'wp-content/object-cache.php' ) ) { WP_CLI::error( 'Unable to copy object-cache.php file.' ); } } } } );