[wp-trac] [WordPress Trac] #46370: A proposal for creating an API to register and enqueue web fonts

WordPress Trac noreply at wordpress.org
Fri Oct 1 04:53:02 UTC 2021


#46370: A proposal for creating an API to register and enqueue web fonts
--------------------------------------+-----------------------------------
 Reporter:  jonoaldersonwp            |       Owner:  (none)
     Type:  feature request           |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  General                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance, privacy
--------------------------------------+-----------------------------------

Comment (by aristath):

 @flixos90 I refactored the patch and the suggestion from above now works
 like this:
 {{{#!php
 <?php
 wp_enqueue_webfont( 'roboto-400', '', array(
     'font-family'  => 'Roboto',
     'font-display' => 'swap',
     'font-style'   => 'normal',
     'font-weight'  => '400',
     'provider'     => new WP_Fonts_Provider_Google(),
 ) );
 }}}

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


More information about the wp-trac mailing list