WordPress怎么给编辑增加字号和字体选择

2021年08月06日/ 浏览 41

WordPress怎么给编辑增加字号和字体选择,其实比较简单,在当前WordPress模板函数文件functions.php添加以下代码即可

/* wp编辑器增加字体和字体大小设置 */
function MBT_add_editor_buttons($buttons) {
 $buttons[] = 'fontselect';
 $buttons[] = 'fontsizeselect';
 $buttons[] = 'cleanup';
 $buttons[] = 'styleselect';
 $buttons[] = 'del';
 $buttons[] = 'sub';
 $buttons[] = 'sup';
 $buttons[] = 'copy';
 $buttons[] = 'paste';
 $buttons[] = 'cut';
 $buttons[] = 'image';
 $buttons[] = 'anchor';
 $buttons[] = 'backcolor';
 $buttons[] = 'wp_page';
 $buttons[] = 'charmap';
 return $buttons;
}
add_filter("mce_buttons_2", "MBT_add_editor_buttons");
picture loss