WordPress教程

WordPress后台编辑器快速标签

阿里云

WordPress 后台编辑器里已经内置了一些标签(/wp-includes/js/quicktags.min.js)

edButtons[10] = new qt.TagButton('strong','b','<strong>','</strong>','b');
edButtons[20] = new qt.TagButton('em','i','<em>','</em>','i'),
edButtons[30] = new qt.LinkButton(), // special case
edButtons[40] = new qt.TagButton('block','b-quote','\n\n<blockquote>','</blockquote>\n\n','q'),
edButtons[50] = new qt.TagButton('del','del','<del datetime="' + _datetime + '">','</del>','d'),
edButtons[60] = new qt.TagButton('ins','ins','<ins datetime="' + _datetime + '">','</ins>','s'),
edButtons[70] = new qt.ImgButton(), // special case
edButtons[80] = new qt.TagButton('ul','ul','<ul>\n','</ul>\n\n','u'),
edButtons[90] = new qt.TagButton('ol','ol','<ol>\n','</ol>\n\n','o'),
edButtons[100] = new qt.TagButton('li','li','\t<li>','</li>\n','l'),
edButtons[110] = new qt.TagButton('code','code','<code>','</code>','c'),
edButtons[120] = new qt.TagButton('more','more','<span id="more-16803"></span>','','t'),
edButtons[140] = new qt.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 />' );

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

WordPress 后台编辑器快速标签

已有 526 人购买
查看演示升级 VIP立刻购买

收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!