[wp-trac] [WordPress Trac] #39481: Twenty Seventeen: Allowing Google fonts in child themes

WordPress Trac noreply at wordpress.org
Fri Jan 6 04:18:18 UTC 2017


#39481: Twenty Seventeen: Allowing Google fonts in child themes
---------------------------+------------------------------
 Reporter:  tsvikas        |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+------------------------------

Comment (by dd32):

 TwentySeventeen doesn't have pluggable functions (`function_exists()`),
 and I'd argue that it shouldn't.

 You shouldn't be redefining `twentyseventeen_fonts_url()` in the child
 theme IMHO, but rather either unhooking, or adding an extra filter.

 I'd be doing something like:
 {{{
 add_action( 'wp_enqueue_scripts', 'mychild_scripts' );
 function mychild_scripts() {
    wp_enqueue_style( 'mychild-fonts',
 'https://fonts.googleapis.com/css/....', array(), null );
    // optionally, remove the existing fonts:
    wp_dequeue_style( 'twentyseventeen-fonts' );
 }
 }}}

 I'll leave this up to @karmatosed and @davidakennedy though

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


More information about the wp-trac mailing list