Ang WordPress text editor ay nagdaragdag ng mga custom na shortcut na button sa tab

Magdagdag ng custom na shortcut button sa WordPress text editor

Idagdag ang sumusunod na code sa file ng function ng iyong tema ng WordPress:

//添加HTML编辑器自定义快捷标签按钮
add_action('after_wp_tiny_mce', 'add_button_mce');
function add_button_mce($mce_settings) {
?>
<script type="text/javascript">
 QTags.addButton( 'hr', 'hr', "\n<hr />\n", "" );
 QTags.addButton( 'h1', 'h1', "\n<h1>", "</h1>\n" );
 QTags.addButton( 'h2', 'h2', "\n<h2>", "</h2>\n" );
 QTags.addButton( 'h3', 'h3', "\n<h3>", "</h3>\n" );
 QTags.addButton( 'pre', 'pre', "\n<pre>\n", "\n</pre>\n" );
</script>
<?php
}?

发表 评论

您的邮箱地址不会被公开。必填项已用*标注

Mag-scroll sa Tuktok