テキストエディタにボタンを追加
2015.05.13
function.php
に下記を記述。
h1やショートコードなどを登録しておくと便利。
function custom_add_quicktags() {
if (wp_script_is('quicktags')){
?>
<script>
// QTags.addButton( id, ボタンテキスト, 開始タグ, 終了タグ, アクセスキー, タイトル, 優先順位(1が先頭) );
// <h2>ボタン
QTags.addButton( 'h2', 'h2', '<h2>', '</h2>', '', 'h2タグ', 1);
</script>
<?php
}
}
add_action( 'admin_print_footer_scripts', 'custom_add_quicktags' );