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

WordPress Trac wp-trac at lists.automattic.com
Mon May 14 08:23:28 UTC 2012


#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 markjaquith):

 I think we can do better. The problem is that Plugin A might flush before
 Plugin B has added its rule. We can add a new hook, but there are lots of
 well-behaved plugins that add their rules on 'admin_init', but are getting
 their rules erased by plugins that flush too early.

 When a plugin flushes the rules, it generally doesn't need that rule to be
 present on the current page load. So, why don't we just change
 {{{flush_rewrite_rules()}}} so that instead of immediately flushing, it
 queues a flush for shutdown. That way, all other plugins get their shot to
 add their rules. And if multiple plugins are calling flushes, we'll just
 do one, at the end of the page load.

 We should, however, also considering blocking front end flushes and give
 them a "doing it wrong" notice.

 Also worth thinking about is how we could use hashing to do automatic
 flushes when a new plugin adds its rule. There has to be a performant way
 to do that. Thoughts?

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


More information about the wp-trac mailing list