[wp-trac] [WordPress Trac] #30579: wp_enqueue_style in footer

WordPress Trac noreply at wordpress.org
Thu Dec 18 23:40:06 UTC 2014


#30579: wp_enqueue_style in footer
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Script Loader                        |  Review
 Severity:  normal                               |     Version:  2.6
 Keywords:  good-first-bug has-patch needs-      |  Resolution:
  testing                                        |     Focuses:  template,
                                                 |  performance
-------------------------------------------------+-------------------------

Comment (by evasivesoftware):

 Replying to [comment:6 kevdotbadger]:
 > I think the point is that you're allowed `<link>`s in the body, so there
 might be a reason why a template author wants to load it in the `<body>`.
 It's another great WP inconsistency, you have the `in-footer` option when
 loading scripts, but that option is missing from this loader, dispute
 there being a method in the loader to do just that.
 >
 > Another solution would be to ignore anything that's queued after
 `wp_head()`, and actually use an `in-footer` option to place `<link>`s in
 the footer. But I think that'll break backwards compatibility.

 Good point, I just think it sounds slightly messy. Utilizing DOM to create
 the link and inject into <head> is valid with either HTML4/5 and seems
 more robust (still hacky, none-the-less)

 As you mentioned, rejecting things queued after wp_head() would be ideal.
 I don't see any situation where a stylesheet cannot be registered before
 wp_head() in cases that they are required before in-footer. How much
 cleanliness should be sacrificed to support lower level developers?

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


More information about the wp-trac mailing list