[wp-trac] [WordPress Trac] #18450: New safe action to add rewrite rules on

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 17 08:14:58 UTC 2011


#18450: New safe action to add rewrite rules on
------------------------------------+------------------------------
 Reporter:  simonwheatley           |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Rewrite Rules           |     Version:  3.2.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------

Comment (by simonwheatley):

 Replying to [comment:2 nacin]:
 > sil_call_add_rewrite_rules() should be called on init, always.
 >
 > On activate: Register rewrite rules and flush
 >
 > On init: Register rewrite rules

 The situation with hooking init to ```add_rewrite_rule``` calls is
 uncertain: If you run ```add_rewrite_rules``` on init at priority 10, then
 conditionally flush the rules, there's no guarantee that all rules from
 other plugins are there at that point. So perhaps you decide to run all
 your ```add_rewrite_rule``` calls with a priority of 0 and all your
 flushes with a priority of 10… you're still not entirely safe though, as
 some other plugin could run flush at an earlier point in the init calls at
 some ridiculously early priority.

 The addition of a ```pre_flush_rewrite_rules``` hook makes life a lot
 simpler for the future.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18450#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list