打开 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