WordPress教程

WordPress怎么给后台编辑器添加按钮

阿里云

WordPress 网站后台编辑器的按钮比较少,为了满足用户的需求,Wordpress 是允许用户自己添加自定义按钮的。

WordPress 给后台编辑器添加按钮的方法也很简单。只需要在自己使用的 WordPress 模板函数里添加以下的代码即可:

  1. //添加HTML编辑器自定义快捷标签按钮
  2. add_action('after_wp_tiny_mce', 'add_button_mce');
  3. function add_button_mce($mce_settings)
  4. {?>
  5. <script type="text/javascript">
  6. QTags.addButton( 'hr', 'hr', "<hr />", "" );
  7. QTags.addButton( 'h1', 'h1', "<h1>", "</h1>" );
  8. QTags.addButton( 'h2', 'h2', "<h2>", "</h2>" );
  9. QTags.addButton( 'h3', 'h3', "<h3>", "</h3>" );
  10. </script>
  11. <?php}
也想出现在这里?联系我们
创客主机

WordPress 怎么给后台编辑器添加按钮

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

收藏
(0)

发表回复

热销模板

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

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