[wp-trac] [WordPress Trac] #37561: Inserting rewrite rules using the filter 'option_rewrite_rules' breaks 'WP_Rewrite::flush_rules()', causing 404 errors

WordPress Trac noreply at wordpress.org
Wed Aug 10 21:19:11 UTC 2016


#37561: Inserting rewrite rules using the filter 'option_rewrite_rules' breaks
'WP_Rewrite::flush_rules()', causing 404 errors
---------------------------+------------------------------
 Reporter:  maratbn        |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Rewrite Rules  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  close          |     Focuses:
---------------------------+------------------------------

Comment (by maratbn):

 Replying to [comment:2 dd32]:
 > The `option_rewrite_rules` filter really isn't the right place to add
 rewrite rules, and IMHO makes this an invalid approach that makes this a
 Gravity Forms bug more so than a core issue.
 >
 > The proper way would be to filter on `rewrite_rules_array` or use
 `add_rewrite_rule()` (probably with the  3rd arg set to`top`).

 In my communications with the Gravity Forms people, they said that they
 tried using some other filters, but that caused them some other issues and
 conflicts, so they switched to this one several years ago.

 In any case, this bug is effecting not the Gravity Forms itself, but the
 WordPress users that use it in combination with some other themes /
 plugins, such as the Jupiter Theme.  Regardless of whose fault it is, the
 innocent users should not have to bear the burden, and WordPress should be
 resilient enough to still work properly even if some theme or plugin is
 not coded in the most optimal way.

 At the present time, the Jupiter theme people are saying that this is a
 Gravity Forms bug, the Gravity Forms people are saying that this is a
 WordPress / Jupiter theme bug (b/c the Jupiter theme is flushing rewrite
 rules inside page requests, likely b/c they also had some issues and
 conflicts doing it otherwise), and you guys are saying that this is a
 Gravity Forms bug.  Excuses excuses. :(

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


More information about the wp-trac mailing list