[wp-trac] [WordPress Trac] #29118: Registering rewrite rules is hard, so let's introduce remove_rewrite_rule.

WordPress Trac noreply at wordpress.org
Sat May 23 10:26:47 UTC 2015


#29118: Registering rewrite rules is hard, so let's introduce remove_rewrite_rule.
---------------------------+------------------------------
 Reporter:  ericlewis      |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Rewrite Rules  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+------------------------------

Comment (by Chouby):

 > However, there is a race condition on the deactivate request: init
 triggers first, adding your rewrite rule, so when you flush rewrite rules
 in the deactivation function, the rewrite rule persists.

 I use this test just after calling register_deactivation_hook() to detect
 if the plugin is currently being de-activated:
 {{{
 if (isset($_GET['action'], $_GET['plugin']) && 'deactivate' ==
 $_GET['action'] && plugin_basename(__FILE__) == $_GET['plugin'])
         return;
 }}}
 So when the plugin is de-activated, only the function hooked to
 register_deactivation_hook() is executed.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29118#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list