给WordPress的超文本编辑器(tinyMCE)增加按钮
虽然有人对WordPress自带的超文本编辑器(tinyMCE)视之蔽履,但我却对它十分喜欢。
有很多和我一样喜欢WYSIWYG编辑器的用户都在使用增强其功能(模块)的插件,而我更建议大家直接通过修改代码的形式获得同样的功能——毕竟,插件能少则少。
先上图

要修改的文件为wp-includes\js\tinymce\tiny_mce_gzip.php
第126行到134行
$plugins = implode($plugins, ',');
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright' ,'separator', 'link', 'unlink', 'image', 'wordpress', 'separator', 'undo', 'redo', 'code', 'wphelp'));
$mce_buttons = implode($mce_buttons, ',');
$mce_buttons_2 = apply_filters('mce_buttons_2', array());
$mce_buttons_2 = implode($mce_buttons_2, ',');
$mce_buttons_3 = apply_filters('mce_buttons_3', array());
$mce_buttons_3 = implode($mce_buttons_3, ',');
$mce_browsers = apply_filters('mce_browsers', array('msie', 'gecko', 'opera'));
$mce_browsers = implode($mce_browsers, ',');
修改为
$plugins = implode($plugins, ',');
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright' ,'separator', 'link', 'unlink', 'image', 'wordpress', 'separator', 'undo', 'redo', 'code', 'wphelp'));
$mce_buttons = implode($mce_buttons, ',');
$mce_buttons_2 = apply_filters('mce_buttons_2', array('fontselect', 'fontsizeselect', 'forecolor', 'cut', 'copy', 'paste', 'backcolor', 'sub', 'sup'));
$mce_buttons_2 = implode($mce_buttons_2, ',');
$mce_buttons_3 = apply_filters('mce_buttons_3', array());
$mce_buttons_3 = implode($mce_buttons_3, ',');
$mce_browsers = apply_filters('mce_browsers', array('msie', 'gecko', 'opera'));
$mce_browsers = implode($mce_browsers, ',');
说明:
$plugins = implode($plugins, ',');
为加载的外挂,
$mce_buttons = implode($mce_buttons, ',');
$mce_buttons_2 = apply_filters('mce_buttons_2', array('fontselect', 'fontsizeselect', 'forecolor', 'cut', 'copy', 'paste', 'backcolor', 'sub', 'sup'));
$mce_buttons_2 = implode($mce_buttons_2, ',');
$mce_buttons_3 = apply_filters('mce_buttons_3', array());
$mce_buttons_3 = implode($mce_buttons_3, ',');
分别为每一行的按钮位置,全凭自己喜好修改。
注意:此文件需用16位编辑器修改,切记。
还是来一个已经修改好的文件:wp-includes\js\tinymce\tiny_mce_gzip.php
02月 9th, 2007在17:10
老冬瓜,很想你呢~~
04月 19th, 2007在18:55
虽然你的日志很奇特,我什么也看不懂,但是我还是决定给你个面子,留个脚印,我来过!
04月 19th, 2007在18:58
哦,对了,赶紧弄点我看得懂的!!