Skip to content
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

Warn when managing rewrites with --skip-plugins or --skip-themes #3827

Closed
danielbachhuber opened this issue Feb 21, 2017 · 3 comments
Closed

Comments

@danielbachhuber
Copy link
Member

WordPress' rewrites API requires the rewrite rules to be registered in order to be saved to the database.

If you run wp rewrite flush with --skip-plugins or --skip-themes, you can inadvertently miss saving rewrites registered in plugins or themes.

To help the user realize their mistake, we should provide a warning when they use wp rewrite * with --skip-plugins or --skip-themes to alert them to the fact that some rewrite rules may be missing.

@leepeterson
Copy link

@danielbachhuber I think perhaps the language should reflect exactly what did not load themes, or perhaps why themes were not loaded.

Warning: Some rewrite rules may be missing because themes weren't loaded.

...might change to...

Warning: Some rewrite rules may be missing because themes weren't loaded by WP-CLI.

...or...

Warning: Some rewrite rules may be missing because skip-themes is set.

In the case of WordPress living in its own subdirectory, if WP_DEFAULT_THEME is not set, or if register_theme_directory() is not called, a wp-cli user may think a step was missed during setup when "themes weren't loaded" is encountered.

@danielbachhuber
Copy link
Member Author

@leepeterson Sure, can you open a new issue for it?

@leepeterson
Copy link

Yes, sir. Thank you.

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

No branches or pull requests

2 participants