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

Interface for add_rewrite_rule #27

Closed
doc987 opened this issue Oct 27, 2018 · 2 comments
Closed

Interface for add_rewrite_rule #27

doc987 opened this issue Oct 27, 2018 · 2 comments

Comments

@doc987
Copy link

doc987 commented Oct 27, 2018

Is there a a way to add a rewrite rule with wp-cli?

@swissspidy
Copy link
Member

Rewrite rules need to be added in a plugin or theme and then rewrite rules need to be updated in the database afterwards.

Although the rewrite rules are stored in the database, they should still be in the plugin so that you can remove them upon deactivation.

So as you can see, this isn‘t really something WP-CLI could do.

@schlessera
Copy link
Member

Yes, indeed. WP-CLI can only make changes that can be persisted into the database. For changes that need to be persisted in code, there's no default location for WP-CLI to act on.

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

3 participants