WP-Syntaxcoolcode都是非常优秀的代码高亮插件,我选择了WP-Syntax。
由于安装插件之后不每次都要在代码里手动添加标签,所以在编辑器里添加了Mycode的按钮。
在搜索引擎里找了到了popdo网友的文章一键插入WP-Syntax插件代码, 刚好解决了这个问题。

找到wp-includesjsquicktags.js这个文件

查找:

edButtons[edButtons.length] =
new edButton('ed_code'
,'code'
,'<code>'
,'</code>'
,'c'
);

在下边增加:

edButtons[edButtons.length] =
new edButton('ed_mycode'
,'mycode'
,'< pre lang="php">'
,'< /pre>'
,'z'
);

把标签中的空格去掉

WP-Syntax支持的语言

abap, actionscript, actionscript3, ada, apache, applescript, aptsources, asm, asp, autoit, avisynth, bash, bf, blitzbasic, bnf, boo, c, cmac, caddcl, cadlisp, cil, cfdg, cfm, cobol, cpp-qt, cpp, csharp, css, d, delphi, diff, div, dos, dot, eiffel, email, fortran, freebasic, genero, gettext, glsl, gml, bnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, lolcode lotusformulas, lotusscript, lscript, lua, m68k, make, matlab, mirc, mpasm, mxml, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle11, oracle8, pascal, per, pic16, pixelbender, perl, php-brief, php, plsql, povray, powershell, progress, prolog, providex, python, qbasic, rails, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, xml, xorg_conf, xpp, z80