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

WordPress Trac noreply at wordpress.org
Wed Jun 7 17:17:19 UTC 2023


#46370: Fonts API: a proposal for creating an API to register and enqueue web fonts
--------------------------------+-----------------------------------
 Reporter:  jonoaldersonwp      |       Owner:  hellofromTonya
     Type:  feature request     |      Status:  assigned
 Priority:  normal              |   Milestone:  6.3
Component:  General             |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  needs-testing-info  |     Focuses:  performance, privacy
--------------------------------+-----------------------------------

Comment (by domainsupport):

 Hi,

 I am attempting to test this brilliant addition by using
 `wp_deregister_font_family()` to remove fonts added by the theme's
 `theme.json`.

 It looks like the themes' fonts are added here ...

 {{{
 add_action( 'init', 'gutenberg_register_fonts_from_theme_json', 21 );
 }}}

 So in theory this would work ...

 {{{#!php
 <?php
 add_action( 'init', 'deregister_fonts_from_theme_json', 22 );
 function deregister_fonts_from_theme_json() {
 wp_deregister_font_family('ibm-plex-mono');
 }
 }}}

 ... but the font is still showing in the "Dashboard - Appearance - Editor
 - Styles - Typography - Text - Typography" dropdown.

 Please can someone advise where this function should be called if not on
 the `init` hook with priority 22?

 Thank you,

 Oliver

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


More information about the wp-trac mailing list