[wp-trac] [WordPress Trac] #47686: Always flush rewrite rules when active plugins changes & on plugin upgrades

WordPress Trac noreply at wordpress.org
Thu Jul 11 21:02:29 UTC 2019


#47686: Always flush rewrite rules when active plugins changes & on plugin upgrades
-----------------------------+-----------------------------
 Reporter:  johnjamesjacoby  |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 I think it's odd that plugins each need to roll their own rewrite rule
 flushing.

 It's definitely nice to have the freedom to decide when it's necessary,
 but it is inconvenient as a developer to reinvent a new way with every new
 plugin whenever a rule needs to be changed.

 It's also inconvenient to users when a plugin forgets to flush rules, or
 when a developer is unaware that it is their responsibility to flush their
 own rules.

 I'm proposing here that WordPress core could improve the lives of both
 developers and users by automatically flushing rewrite rules every time a
 plugin is activated, deactivated, or updated.

 For context, `flush_rewrite_rules()` is already called inside of
 `check_theme_switched()` which in hooked to `init` and always flushes
 rewrite rules when a new theme is activated, and I'm suggesting we
 consider doing this for plugins too.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47686>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list