I use Custom Post Types. I try this:
functions.php
add_action( 'admin_init', 'flush_rewrite_rules' );
Now Iâd like to remove this again. I try this:
remove_action( 'admin_init', 'flush_rewrite_rules' );
Iâm not sure if it works right. How can I test if the rewrite rules really not flushed anymore?
To see if the option
'rewrite_rules'
was reset â thatâs whatflush_rewrite_rules()
does internally â hook into the option actions and log what happens.The following small plugin does that. It will tell you what code flushed the rewrite rules and how the rules looked before and after the flush. If no flush happened it just says
nothing logged
. 🙂