id, array( 'widgets', 'nav-menus' ), true ) ) { return; } // Enqueue fonts. wp_enqueue_style( 'pressbook-grid-dark-editor-fonts', PressBook_Grid_Dark_Scripts::fonts_url(), array(), null ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion // Add inline style for fonts in the block editor. $this->load_editor_fonts_css(); // Enqueue the block editor stylesheet. wp_enqueue_style( 'pressbook-grid-dark-block-editor-style', get_theme_file_uri( 'inc/block-editor.css' ), array(), PRESSBOOK_GRID_DARK_VERSION ); // Add output of customizer settings as inline style. wp_add_inline_style( 'pressbook-grid-dark-block-editor-style', PressBook_Grid_Dark_CSSRules::output_editor() ); } /** * Add inline style for fonts in the block editor. */ public function load_editor_fonts_css() { $fonts_css = ''; /* translators: If there are characters in your language that are not supported by Inter, translate this to 'off'. Do not translate into your own language. */ $inter = _x( 'on', 'Inter font (in the editor): on or off', 'pressbook-grid-dark' ); if ( 'off' !== $inter ) { $fonts_css .= ( '.block-editor-page .editor-styles-wrapper{font-family:\'Inter\', Arial, Helvetica, sans-serif;}' ); } /* translators: If there are characters in your language that are not supported by Lato, translate this to 'off'. Do not translate into your own language. */ $lato = _x( 'on', 'Lato font (in the editor): on or off', 'pressbook-grid-dark' ); if ( 'off' !== $lato ) { $fonts_css .= ( '.editor-styles-wrapper .editor-post-title__input,.editor-styles-wrapper .editor-post-title .editor-post-title__input,.editor-styles-wrapper h1,.editor-styles-wrapper h2,.editor-styles-wrapper h3,.editor-styles-wrapper h4,.editor-styles-wrapper h5,.editor-styles-wrapper h6{font-family:\'Lato\', Helvetica, Arial, sans-serif;}' ); } if ( '' !== $fonts_css ) { wp_add_inline_style( 'pressbook-grid-dark-editor-fonts', $fonts_css ); } } }