[wp-trac] [WordPress Trac] #36579: global $wp_rewrite not set when create_initial_post_types() first run

WordPress Trac noreply at wordpress.org
Tue Apr 19 02:32:46 UTC 2016


#36579: global $wp_rewrite not set when create_initial_post_types() first run
-------------------------------+------------------------------
 Reporter:  bobbingwide        |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  4.4
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------

Comment (by dd32):

 It's worth noting, that plugins are loaded after the initial call of
 `create_initial_post_types()`. It's only mu-plugins and other dropins
 which get in there first that this could affect.

 I actually think the solution in this case is that plugins shouldn't hook
 into `register_post_type_args` until at least `plugins_loaded` is fired.

 `create_initial_post_types()` is called twice as many plugins expected the
 post types (and taxonomies) to be setup before `init`.

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


More information about the wp-trac mailing list