Skip to content

Conversation

janw-me
Copy link
Member

@janw-me janw-me commented Apr 5, 2023

Cache flushes on all sites, not just the current url.

Fixes #78

@janw-me janw-me requested a review from a team as a code owner April 5, 2023 12:12
$value = wp_cache_flush();

if ( WP_CLI::has_config( 'url' ) && ! empty( WP_CLI::get_config()['url'] ) && is_multisite() ) {
WP_CLI::warning( 'You are using a multisite installation. Flushing the cache will flush the cache for all sites.' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about a message like this?

Ignoring the --url=<url> argument because flushing the cache affects all sites on a multisite installation.

I think it's worth explicitly mentioning the cause of the warning message. I also don't know how often we use "You" in messages...

image

@janw-me janw-me closed this Apr 5, 2023
@janw-me
Copy link
Member Author

janw-me commented Apr 5, 2023

@danielbachhuber I agree, the "you" was pretty strange.
Lives on in #86 as I polluted my fork's main branch and broke this pr by accident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn when attempting to flush cache with --url on multisite

2 participants