打开 wp-includes/js/quicktags.dev.js ,找到

  1. edButtons[edButtons.length] =
  2. new edButton('ed_code'
  3. ,'code'
  4. ,'<code>'
  5. ,'</code>'
  6. ,'c'
  7. );

在下面添加:

  1. edButtons[edButtons.length] =
  2. new edButton('ed_coolcode'
  3. ,'coolcode'
  4. ,'<coolcode linenum=\"off\">'
  5. ,'</coolcode>'
  6. ,'x'
  7. );

再找到

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