Reputation: 23
I am trying to return a custom list of font sizes without the use of a plugin for Wordpress. The function I am trying to use currently is below. I have used similar functions to customize the color picker and the format select, but not having any luck with this one. Any help is appreciated.
function mycustom_change_tinymce_fontsize( $init ) {
$custom_sizes = '"14pt", "18pt"';
$init['fontsize_formats'] = '['.$custom_sizes.']';
return $init;
}
add_filter('tiny_mce_before_init', 'mycustom_change_tinymce_fontsize');
Upvotes: 0
Views: 450
Reputation: 6189
Your formatted value is not correct; just follow the below one:
function mycustom_change_tinymce_fontsize( $init ) {
//$init['fontsize_formats'] = "10px 11px 12px 13px 14px 15px 16px 17px 18px 19px 20px 21px 22px 23px 24px 25px 26px 27px 28px 29px 30px 32px";
$init['fontsize_formats'] = "14pt 18pt";
return $init;
}
add_filter('tiny_mce_before_init', 'mycustom_change_tinymce_fontsize', 12); //-->somewhat important '12', at least more than 10 to keep your changes;
Upvotes: 1