Support » Plugin: Fluent Support - WordPress Helpdesk and Customer Support Ticket Plugin » How to change the font family in TinyMCE

  • Resolved listblank

    (@listblank)


    How to change the font-family in an external editor if the following construct doesn’t work:

    add_editor_style('css/editor-style.css')

    in functions.php, and next:

    function new_font_for_tinymce( $mceInit ) {
      $font_family = get_theme_mod( 'font_family' );
      $styles = '.mce-content-body { font-family: Roboto' . $font_family . '; }';
    
      if ( !isset( $mceInit['content_style'] ) ) {
        $mceInit['content_style'] = $styles . ' ';
      } else {
        $mceInit['content_style'] .= ' ' . $styles . ' ';
      }
      return $mceInit;
    
    }
    add_filter( 'tiny_mce_before_init', 'new_font_for_tinymce' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.