[wp-trac] [WordPress Trac] #37171: Implement preconnect to Google fonts in themes twenty eleven, twelve, thirteen, fourteen, fifteen, sixteen

WordPress Trac noreply at wordpress.org
Tue Sep 20 09:50:43 UTC 2016


#37171: Implement preconnect to Google fonts in themes twenty eleven, twelve,
thirteen, fourteen, fifteen, sixteen
----------------------------------------+--------------------------
 Reporter:  superpoincare               |       Owner:
     Type:  feature request             |      Status:  new
 Priority:  normal                      |   Milestone:  4.7
Component:  Bundled Theme               |     Version:  4.6
 Severity:  normal                      |  Resolution:
 Keywords:  good-first-bug needs-patch  |     Focuses:  performance
----------------------------------------+--------------------------

Comment (by superpoincare):

 Replying to [comment:15 leobaiano]:

 Great. You might be interested in wp_style_is as well. So for example
 twentytwelve adds a body class custom-font-enabled like this (lines
 446-448):

 https://github.com/WordPress/WordPress/blob/master/wp-
 content/themes/twentytwelve/functions.php#L446-L448


 {{{
 // Enable custom font class only if the font CSS is queued to load.
 if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) )
                 $classes[] = 'custom-font-enabled';
 }}}


 You could then add the resource hint for preconnect similarly.

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


More information about the wp-trac mailing list