DB-hub Technology WordPress 开启WordPress隐藏的编辑器功能

开启WordPress隐藏的编辑器功能

WordPress默认不支持TinyMCE的全部功能,但它支持的功能也没有全部开启。

将下面的代码放到主题的functions.php中,就可以开启全部隐藏功能。

function add_mce_buttons_1(buttons) {buttons = array('newdocument','undo','redo','|','bold','italic','underline','strikethrough','|','justifyleft','justifycenter','justifyright','justifyfull','|','styleselect','formatselect','fontselect','fontsizeselect','wp_more','wp_adv');
return buttons;
}

function add_mce_buttons_2(buttons) {
buttons = array('cut','copy','paste','pastetext','pasteword','|','search','replace','|','bullist','numlist','|','outdent','indent','blockquote','|','|','link','unlink','anchor','image','cleanup','code','|','forecolor','backcolor','hr','removeformat','visualaid','|','sub','sup','|','spellchecker','charmap','fullscreen','wp_help');
returnbuttons;
}

add_filter("mce_buttons", "add_mce_buttons_1");
add_filter("mce_buttons_2", "add_mce_buttons_2");

Leave a Reply

您的邮箱地址不会被公开。 必填项已用 * 标注

Related Post