Tags: / Posted in 程序开发

WP-Syntax添加按钮到WordPress编辑器

ken 2009-06-07 Hit: 397

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'
);

把标签中的空格去掉

相关日志

欢迎订阅: Google Reader | 鲜果 | 抓虾 | 九点 | QQ邮箱 | 有道 | 更多

1 条评论

  • (Required)
  • (Required, will not be published)