That’s… strange.
Do you mean the .htaccess
file gets emptied or just the rewrite rules get messed up? We run flush_rewrite_rules()
during plugin deactivation, which is normal behaviour for such a plugin.
Custom rules added by other plugins within the <IfModule mod_rewrite.c>
block are deleted during deactivation of this plugin. The standard WordPress permalink rules remain.
That sounds like a bug in those other plugins or perhaps in WordPress itself.
flush_rewrite_rules()
re-builds the rewrite rules and — if it’s a hard flush (which is the default) — also updates the .htaccess
file. But: It only updates the rules inside the # BEGIN WordPress
and # END WordPress
markers. Other plugins shouldn’t add their rules inside this block.
To sum up:
- Many plugins flush rewrite rules on plugin (de)activation, it’s the way we need to do it.
- Other plugins shouldn’t interfere with the core rewrite rules
- The problem has to be elsewhere
I’ll mark this topic as resolved, but will open an issue about doing a soft flush on GitHub. It’s not really our fault, but we want a great new-user experience after all.
The standard method – using add_rewrite_rule
– inserts the defined custom rules within the # BEGIN WordPress
and # END WordPress
markers.
Activating oEmbed (0.4.0-20150827) no longer adds htaccess rules. Is that correct?
Deactivating oEmbed continues to remove all custom rules formerly added by other plugins using add_rewrite_rule
.