蚂蚱也是肉
点滴汇聚,终成大海

为WordPress3.5.1编辑器添加WP-Syntax按钮

1.找到\wp-includes\js\quicktags.js 添加以下几行 每行结尾< /pre>去除空格

PHP
’,’pp’),
edButtons[130] = new qt.TagButton(‘html_pre’,’html_pre’,' ’,’ppp’),
edButtons[140] = new qt.TagButton(‘js_pre’,’js_pre’,' ’,’pppp’),
edButtons[150] = new qt.TagButton(‘asp_pre’,’asp_pre’,' ’,’ppppp’),
edButtons[160] = new qt.TagButton(‘sql_pre’,’sql_pre’,' ’,’pppppp’),
edButtons[170] = new qt.TagButton(‘mysql_pre’,’mysql_pre’,' ’,’ppppppp’),

[js]
edButtons[120] = new qt.TagButton(‘php_pre’,’php_pre’,'<pre lang="php" line="1">’,'< /pre>’,’pp’),
edButtons[130] = new qt.TagButton(‘html_pre’,’html_pre’,'<pre lang="html4strict" line="1">’,'< /pre>’,’ppp’),
edButtons[140] = new qt.TagButton(‘js_pre’,’js_pre’,'<pre lang="javascript" line="1">’,'< /pre>’,’pppp’),
edButtons[150] = new qt.TagButton(‘asp_pre’,’asp_pre’,'<pre lang="asp" line="1">’,'< /pre>’,’ppppp’),
edButtons[160] = new qt.TagButton(‘sql_pre’,’sql_pre’,'<pre lang="sql" line="1">’,'< /pre>’,’pppppp’),
edButtons[170] = new qt.TagButton(‘mysql_pre’,’mysql_pre’,'<pre lang="mysql" line="1">’,'< /pre>’,’ppppppp’),
[/js]

注:edButtons[120] 红色数字请根据原顺序顺排

2.找到\wp-includes\js\quicktags.min.js 添加以下代码 每个< /pre>去除空格

”,”ppp”),edButtons[140]=new c.TagButton(“js_pre”,”js_pre”,”

”,”pppp”),edButtons[150]=new c.TagButton(“asp_pre”,”asp_pre”,”

”,”ppppp”),edButtons[160]=new c.TagButton(“sql_pre”,”sql_pre”,”

”,”pppppp”),edButtons[170]=new c.TagButton(“mysql_pre”,”mysql_pre”,”

”,”ppppppp”),edButtons[180]=new c.TagButton(“dos_pre”,”dos_pre”,”

”,”pppppppp”),

[js]
edButtons[130]=new c.TagButton("html_pre","html_pre","<pre lang=’html4strict’ line=’1′>","< /pre>","ppp"),edButtons[140]=new c.TagButton("js_pre","js_pre","<pre lang=’javascript’ line=’1′>","< /pre>","pppp"),edButtons[150]=new c.TagButton("asp_pre","asp_pre","<pre lang=’asp’ line=’1′>","< /pre>","ppppp"),edButtons[160]=new c.TagButton("sql_pre","sql_pre","<pre lang=’sql’ line=’1′>","< /pre>","pppppp"),edButtons[170]=new c.TagButton("mysql_pre","mysql_pre","<pre lang=’mysql’ line=’1′>","< /pre>","ppppppp"),edButtons[180]=new c.TagButton("dos_pre","dos_pre","<pre lang=’dos’ line=’1′>","< /pre>","pppppppp"),
[/js]

2013-03-25
3,354 views

发表回复