Ticket #45880: 45880.diff
File 45880.diff, 1.8 KB (added by , 4 years ago) |
---|
-
src/wp-content/themes/twentyseventeen/functions.php
117 117 * This theme styles the visual editor to resemble the theme style, 118 118 * specifically font, colors, and column width. 119 119 */ 120 add_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) ); 120 $editor_style = array( 'assets/css/editor-style.css' ); 121 $fonts_url = twentyseventeen_fonts_url(); 122 if ( $fonts_url ) { 123 $editor_style[] = $fonts_url; 124 } 125 add_editor_style( $editor_style ); 121 126 122 127 // Load regular editor styles into the new block-based editor. 123 128 add_theme_support( 'editor-styles' ); … … 445 450 */ 446 451 function twentyseventeen_scripts() { 447 452 // Add custom fonts, used in the main stylesheet. 448 wp_enqueue_style( 'twentyseventeen-fonts', twentyseventeen_fonts_url(), array(), null ); 453 $fonts_url = twentyseventeen_fonts_url(); 454 if ( $fonts_url ) { 455 wp_enqueue_style( 'twentyseventeen-fonts', $fonts_url, array(), null ); 456 } 449 457 450 458 // Theme stylesheet. 451 459 wp_enqueue_style( 'twentyseventeen-style', get_stylesheet_uri(), array(), '20190507' ); … … 511 519 // Block styles. 512 520 wp_enqueue_style( 'twentyseventeen-block-editor-style', get_theme_file_uri( '/assets/css/editor-blocks.css' ), array(), '20190328' ); 513 521 // Add custom fonts. 514 wp_enqueue_style( 'twentyseventeen-fonts', twentyseventeen_fonts_url(), array(), null ); 522 $fonts_url = twentyseventeen_fonts_url(); 523 if ( $fonts_url ) { 524 wp_enqueue_style( 'twentyseventeen-fonts', $fonts_url, array(), null ); 525 } 515 526 } 516 527 add_action( 'enqueue_block_editor_assets', 'twentyseventeen_block_editor_styles' ); 517 528