Restore default rewrite rules
-
I think than your plugin is superb, but need a little add-on.
I change your Flush rules button, because I think is not necessary, almost for me :-(. I change it for Restore default, to get the default rewrite rules of WordPress and start again with new rules. I think than this is necessary because when the plugin is active there’s not option to do this, without deleting the rewrite_rules_save in wp_options table.
To do this I just add a line to this code:
if(isset($_POST['rule-flush'])) { $wp_rewrite->flush_rules(); $message = 'Rule flushed.'; }And change with this:
if(isset($_POST['rule-flush'])) { $wp_rewrite->flush_rules(); update_option( 'rewrite_rules_save' , $wp_rewrite->wp_rewrite_rules() ); $message = 'Rule flushed and restored.'; }And change this line:
<input id="rule-flush" name="rule-flush" type="submit" class="button" value="Flush rules"/>With this one:
<input id="rule-flush" name="rule-flush" type="submit" class="button" value="Restore default"/>Please add something like this in the futures updates.
Thank’s a lot for your great job.
The topic ‘Restore default rewrite rules’ is closed to new replies.