[wp-trac] [WordPress Trac] #36839: Locale stylesheet loaded early for embeds

WordPress Trac noreply at wordpress.org
Sat May 14 16:38:55 UTC 2016


#36839: Locale stylesheet loaded early for embeds
--------------------------+-----------------------------
 Reporter:  greenshady    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Embeds        |    Version:  4.4
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Typically, locale stylesheets get loaded after other styles have been
 output when hooked to `wp_head`.  However, with embeds on the `embed_head`
 hook, the locale stylesheet is output earlier.  This can cause locale
 stylesheets to get overwritten with CSS applied later.

 Here's a comparison of the priorities between the `wp_head` and
 `embed_head` hooks:

 {{{
 add_action( 'wp_head', 'wp_print_styles', 8 );
 add_action( 'wp_head', 'locale_stylesheet' );

 add_action( 'embed_head', 'wp_print_styles', 20 );
 add_action( 'embed_head', 'locale_stylesheet' );
 }}}

 The `locale_stylesheet` action should get a later priority on `embed_head`
 for consistency.

 This has been in core since 4.4, but it's probably been overlooked because
 most theme authors were not dealing with it.  Now that themes can have
 custom embed templates, this could be a problem.  I know it is for some of
 my themes that have locale-specific stylesheets.

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


More information about the wp-trac mailing list