形式
QTags.addButton( id, display, arg1, arg2, access_key, title, priority, instance );
パラメータ

id

(string) (必須) クイックタグボタンのid

デフォルト: なし

display

(string) (必須) クイックタグボタンの値

デフォルト: なし

arg1

(文字列) (必須) 開始タグ、または、ボタンがクリックされたときに実行されるコールバック。

デフォルト: なし

arg2

(文字列) (任意) 閉じタグ。閉じタグが不要な場合は空欄、(””)にする。

デフォルト: なし

access_key

(文字列) (任意) クイックタグボタンのショートカットアクセスキー

デフォルト: なし

title

(文字列) (任意) クイックタグボタンのタイトルの値

デフォルト: なし

priority

(int) (任意) ツールバーでの各ボタンを表示する順番を指定する。小さいほど先になる。

デフォルト: なし

instance

(文字列) (オプション) Quicktagsの特定のインスタンスにあるボタンを制限し、 存在しない場合はすべてのインスタンスに追加します。

デフォルト: なし

例えば、以下のようなPHPコードをfunctions.phpに書き込む。

// add more buttons to the html editor

function mytheme_add_quicktags() {

if (wp_script_is(‘quicktags’)){

?>

<script type=”text/javascript”>

QTags.addButton( ‘paragraph’, ‘p’, ‘<p>’, ‘</p>’, ‘p’, ‘Paragraph tag’, 1 );

QTags.addButton( ‘div’, ‘div’, ‘<div>’, ‘</div>’, ‘div’, ‘Div tag’, 2 );

QTags.addButton( ‘span’, ‘span’, ‘<span>’, ‘</span>’, ‘span’, ‘Span tag’, 3 );

</script>

<?php

}

}

add_action( ‘admin_print_footer_scripts’, ‘mytheme_add_quicktags’ );