[wp-trac] [WordPress Trac] #39323: Twenty Seventeen: wp_resource_hints when enqueue custom fonts in child theme

WordPress Trac noreply at wordpress.org
Sun Dec 18 12:17:20 UTC 2016


#39323: Twenty Seventeen: wp_resource_hints when enqueue custom fonts in child
theme
---------------------------+-----------------------------
 Reporter:  sami.keijonen  |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Bundled Theme  |    Version:  4.7
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 In Twenty Seventeen we add preconnect for Google Fonts via
 `wp_resource_hints`.

 In there we check that styles are enqueued: `wp_style_is(
 'twentyseventeen-fonts', 'queue' )`.

 In child theme it's pretty common that we dequeue parent fonts and load
 our own Google fonts: `wp_dequeue_style( 'twentyseventeen-fonts' );`

 This means that our `wp_style_is` check is `false` and our preconnect code
 is not printed anymore.

 Could we change the check like this so that preconnect would be in child
 themes also. For example:

 `wp_style_is( 'twentyseventeen-fonts', 'registered' )`.

 Downside is that child theme can use other than Google fonts also. Anyways
 I just wanted to put this out here for discussion.

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


More information about the wp-trac mailing list