[wp-trac] [WordPress Trac] #33922: login_enqueue_scripts and head placement

WordPress Trac noreply at wordpress.org
Fri Sep 18 13:43:03 UTC 2015


#33922: login_enqueue_scripts and head placement
-------------------------+-----------------------------
 Reporter:  tifosi       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 According to the codex for the correct method is to enqueue the style with
 wp_enqueue_style linked to the login_enqueue_script action:
 https://codex.wordpress.org/Plugin_API/Action_Reference/login_enqueue_scripts

 However this places the style in the body of the page just above the body
 tag. This is fine if you're queuing up a block of inline style, but not
 for a link element. Any styles won't be parsed until the page is loaded
 and any overriding css elements will cause jerky refresh issues.

 If you're recommending this hook for login page scripts it needs a way to
 either differentiate the enqueued style i.e. link attr, or an argument
 such as for wp_enquque_scripts where in this case placement in the header
 is forced with a TRUE parameter.

 There is a workaround as this stack exchange query details:
 http://wordpress.stackexchange.com/questions/127835/enqueue-a-stylesheet-
 for-login-page-and-make-it-appear-in-head-element

 Thanks.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33922>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list