WordPress后台编辑器快速标签

  • Post author:
  • Post category:IT
  • Post comments:0评论

WordPress后台编辑器里已经内置了一些标签

edButtons[10]=newqt.TagButton('strong','b','<strong>','</strong>','b');

edButtons[20]=newqt.TagButton('em','i','<em>','</em>','i'),

edButtons[30]=newqt.LinkButton(),// special case

edButtons[40]=newqt.TagButton('block','b-quote','\n\n<blockquote>','</blockquote>\n\n','q'),

edButtons[50]=newqt.TagButton('del','del','<del datetime="'+_datetime+'">','</del>','d'),

edButtons[60]=newqt.TagButton('ins','ins','<ins datetime="'+_datetime+'">','</ins>','s'),

edButtons[70]=newqt.ImgButton(),// special case

edButtons[80]=newqt.TagButton('ul','ul','<ul>\n','</ul>\n\n','u'),

edButtons[90]=newqt.TagButton('ol','ol','<ol>\n','</ol>\n\n','o'),

edButtons[100]=newqt.TagButton('li','li','\t<li>','</li>\n','l'),

edButtons[110]=newqt.TagButton('code','code','<code>','</code>','c'),

edButtons[120]=newqt.TagButton('more','more','<span id="more-16803"></span>','','t'),

edButtons[140]=newqt.CloseButton();

如果想再优化一下,添加自己常用的标签,可以打开 /wp-includes/js/quicktags.min.js

在文件的最后加上自己的tag:

QTags.addButton('js','js','<coolcode lang="javascript">','</coolcode>');

QTags.addButton('h5','h5','<h5>','</h5>');

QTags.addButton('h6','h6','<h6>','</h6>');

QTags.addButton('br','br','<br />');

嗯,仅以此文章警示自己,先看文档再做事。

相关日志:

发表评论