给WordPress文章添加字体、字号大小及颜色等常用按钮

Author: 陌小雨Date: 2014-10-26View: 709

wordpress文本编辑默认没有开启字体选择、大小等常用按钮,实现方法也比较简单

功能代码:

function add_editor_buttons($buttons) {
$buttons[] = 'fontselect';
$buttons[] = 'fontsizeselect';
$buttons[] = 'backcolor';
$buttons[] = 'underline';
$buttons[] = 'hr';
$buttons[] = 'sub';
$buttons[] = 'sup';
$buttons[] = 'cut';
$buttons[] = 'copy';
$buttons[] = 'paste';
$buttons[] = 'cleanup';
$buttons[] = 'wp_page';
$buttons[] = 'newdocument';
return $buttons;
}
add_filter("mce_buttons_3", "add_editor_buttons");

将上述代码放到主题的functions.php中即可