WordPress 2.8 编辑器快速添加 CoolCode 按钮
作者: Bluedata | 可以转载,转载时务必以超链接形式标明文章原始出处和作者信息及版权声明
网址: http://bluedata.org/2009/08/11/wordpress-editor-coolcode-button/
网址: http://bluedata.org/2009/08/11/wordpress-editor-coolcode-button/
打开 wp-includes/js/quicktags.dev.js ,找到
- edButtons[edButtons.length] =
- new edButton('ed_code'
- ,'code'
- ,'<code>'
- ,'</code>'
- ,'c'
- );
在下面添加:
- edButtons[edButtons.length] =
- new edButton('ed_coolcode'
- ,'coolcode'
- ,'<coolcode linenum=\"off\">'
- ,'</coolcode>'
- ,'x'
- );
再找到
t.Buttons[t.Buttons.length] = new edButton(name+'_code','code','<code>','</code>','c');
在下面添加一行:
t.Buttons[t.Buttons.length] = new edButton(name+'_coolcode','coolcode','<coolcode linenum=\"off\">','</coolcode>','x');
然后对 quicktags.js 做同样的修改。
CoolCode 的介绍: http://www.coolcode.cn/?action=show&id=26

















