[wp-trac] [WordPress Trac] #44142: Load Order: save_mod_rewrite_rules assumes wp-admin/includes/file.php is loaded

WordPress Trac noreply at wordpress.org
Sat May 19 15:11:28 UTC 2018


#44142: Load Order: save_mod_rewrite_rules assumes wp-admin/includes/file.php is
loaded
----------------------------+-----------------------
 Reporter:  YuriV           |       Owner:  kraftbj
     Type:  defect (bug)    |      Status:  assigned
 Priority:  normal          |   Milestone:  4.9.7
Component:  Bootstrap/Load  |     Version:  4.9.6
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+-----------------------

Comment (by azaozz):

 In 44142.2.diff:
 - Add `_doing_it_wrong()` and return early when a wrong hook was used to
 call `wp_add_privacy_policy_content()`.
 - Add `_doing_it_wrong()` when rewrite rules are flushed outside wp-admin
 context.

 Also wondering if we should just return early for attempts to flush the
 rewrite rules outside wp-admin instead of making it possible. Seems that
 didn't work/wasn't possible before 4.9.6.

 Note that in normal circumstances `wp_add_privacy_policy_content()` cannot
 be used on the `init` hook. It throws a fatal error right away as `wp-
 admin/includes/admin.php` (Core Administration API) is not loaded yet :)

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


More information about the wp-trac mailing list