• Resolved peterbra

    (@peterbra)


    Hi, I’ve added a custom font-size in tinymce for admin like this:

    function wwiz_mce_add_more_buttons($buttons) {
    	 $buttons[] = 'fontselect';
    	 $buttons[] = 'fontsizeselect';
    	 $buttons[] = 'cleanup';
    	 $buttons[] = 'styleselect';
    	 return $buttons;
    }
    add_filter("mce_buttons_3", "wwiz_mce_add_more_buttons");

    Now I get default font-size drop down: 1(8pt), 2(10pt), 3(12pt) etc..

    Is there a way to make it like: 11px(11px), 12px(12px), 14px(14px) etc.. ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter peterbra

    (@peterbra)

    Ok, for all of you searching for a solution here it goes:

    function wwiz_mce_inits($initArray){
        $initArray['height'] = '600px';
        $initArray['theme_advanced_font_sizes'] = '10px,12px,13px,14px,15px,16px,18px,20px,22px,24px,26px,28px,30px,32px,34px,36px,38px,40px';
        $initArray['font_size_style_values'] = '10px,12px,13px,14px,15px,16px,18px,20px,22px,24px,26px,28px,30px,32px,34px,36px,38px,40px';
        return $initArray;
    }
    add_filter('tiny_mce_before_init', 'wwiz_mce_inits');

    I dont understand where to add this code? It works for new version of TinyMCE?

    Add it to your theme’s function.php file or use the Code Snippets plugin.

    https://www.wpexplorer.com/wordpress-tinymce-tweaks/ for more info

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP TinyMCE set custom font size in pixels’ is closed to new replies.