- function custum_fontfamily($initArray){
- $initArray[‘font_formats’] = “微软雅黑=’微软雅黑’;宋体=’宋体’;黑体=’黑体’;仿宋=’仿宋’;楷体=’楷体’;隶书=’隶书’;幼圆=’幼圆’;”;
- return $initArray;
- }
- add_filter(‘tiny_mce_before_init’, ‘custum_fontfamily’);
- function enable_more_buttons($buttons) {
- $buttons[] = ‘styleselect’;
- $buttons[] = ‘fontselect’;
- return $buttons;
- }
- add_filter(“mce_buttons”, “enable_more_buttons”);
本来还是有第二种方法的,就是修改/wp-includes/js/tinymce/中的tinymce.min.js和wp-tinymce.js.gz中的fontselect后面参数的字体信息,但是我感觉这种方法第一有风险,第二wordpress这段时间更新的比较频繁,还是不写了为好!
评论前必须登录!
注册