wordpress编辑器增加字体选择以及字体大小设置

2023-05-16 13:26:15 浏览数 (1)

效果

将以下代码加入到主题的functions.php里即可:

代码语言:javascript复制
/* wordpress编辑器增加字体选择以及字体大小设置 */
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");
php

0 人点赞