Can I comment "flush" after flushing urls?
-
Hi all,
I have added this function to rewrite some rules in wordpress:
add_action( 'init', 'my_add_rewrite_rules' ); function mydid_add_rewrite_rules() { global $wp_rewrite; add_rewrite_rule(....); .... Added some rewrite rules here... $wp_rewrite->flush_rules(); }
So far, everything works perfect.
After browsing the urls, I supposed that the database containing the rewrite rules was updated and I have commented the line:
// commented the line because this is an "expensive" action and I suppose that the // database is already updated // $wp_rewrite->flush_rules();
However, after commenting, the url rewrite does not work. Why? Wasn’t the database already updated?
p.s. I can not flush from the wp admin panel because of some theme’s constrains…
Thank
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Can I comment "flush" after flushing urls?’ is closed to new replies.