Opened 9 years ago
Closed 9 years ago
#42262 closed enhancement (wontfix)
Permit execution of wp_cache_flush() on multisite before ms-settings.php is loaded
| Reported by: | danielbachhuber | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Bootstrap/Load | Version: | |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: | multisite |
Description
On WordPress multisite, it would be useful to be able to execute wp_cache_flush() before ms-settings.php is loaded.
When a WP-CLI user runs wp cache flush against a WordPress multisite instance that has a stale domain lookup value, they'll see an error like:
Error: Site 'mstest.org/' not found. Verify DOMAIN_CURRENT_SITE matches an existing site or use `--url=<url>` to override.
To bypass the error and flush the cache, the user must run wp cache flush --url=<old-domain>, where <old-domain> is the stale domain lookup value.
wp_cache_flush() doesn't require blog-specific context though, so it's safe to run as soon as the object cache is instantiated.
Open to suggestions on an implementation. One thought is to add a ms_before_load action that WP-CLI can hook into (although it'd then need to throw an exception to pause script execution).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Huh. Now that I've published this,
ms_network_not_foundcould work just fine.