Skip to content

When flushing cache on a multisite give a warning. #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from
Closed

When flushing cache on a multisite give a warning. #83

wants to merge 0 commits into from

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

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