[wp-trac] [WordPress Trac] #49742: No longer able to enqueue multiple Google Fonts with wp_enqueue_style

WordPress Trac noreply at wordpress.org
Fri May 1 02:32:38 UTC 2020


#49742: No longer able to enqueue multiple Google Fonts with wp_enqueue_style
---------------------------+------------------------------
 Reporter:  tannerm        |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by jtleathers):

 [https://wordpress.org/support/topic/new-google-fonts-url-incompatible-
 with-wp_enqueue_style/ Here was the solution offered to me on the forums]

 Basically you have to include **null** as the value for the version
 parameter. So the following code should work:


 {{{
 wp_enqueue_style( 'google-fonts',
 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,700;1,400&family=Neuton:ital,wght@0,300;0,400;0,700;1,400&display=swap',
 array(), null );
 }}}

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


More information about the wp-trac mailing list