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

WordPress Trac noreply at wordpress.org
Sun Dec 14 17:38:08 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
-------------------------------------------------+-------------------------
Changes (by kevdotbadger):

 * keywords:  needs-patch good-first-bug => good-first-bug has-patch needs-
     testing
 * focuses:  performance => template, performance


Comment:

 Actually, having dug into this a little more it seems that HTML5 doesn't
 allow the `<style>` tag outside the `<head>` (without using the scoped
 attribute, which isn't Xbrowser supported at the moment), so you need to
 use the `<link>` tag. However, as mentioned above, the `<link>` tag can
 only be used if it has both the `rel` and `property` attributes defined.
 HTML4 doesn't have a `property` attribute, so you need to use the
 `<style>` tag outside the `<head>`. We can use
 `current_theme_supports('html5')` to determine if we should use either
 `<style>` or `<link>`. This is what the patch uses.

 TD:RD; HTML5 uses `<link>`, HTML4 uses `<style>`.

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


More information about the wp-trac mailing list