For the visual editor you’re adding TinyMCE buttons. For the HTML editor you’re adding “quick tags”.

ビンゴ。

疲れ果てた。

WordPress + Post Editor + Custom + Button なんて検索をすれば、これは割とすぐに見つけることが出来た。ところがこれで見つかるほぼ全てが「ビジュアル」エディタの方にしかボタンが追加されない方法。で、なおかつ「そう言ってない」。どのサイトも。ワタシはむしろビジュアルモードには追加したくなくて、テキストモードだけに追加したかったので、非常に困った。

まず以下のビンゴの質問に、何時間も辿り着けなかった:

PaulWinslow SAYS
Hey all,

I’m adding shortcode buttons to the WP post editor but I’m having trouble working out how to add them in HTML mode.

I’m adding them in visual mode with this line..

if ( get_user_option("rich_editing") == "true" )

I’m assuming I can just replace ‘rich_editing’ with something else but I can’t guess what that is exactly.

Thanks for any help!

「ビンゴ」というのはつまり、この質問、アタシと全く同じ誤解をしてる。「Add buttons to the tinymce editor in HTML mode」という質問が「ハズレ」なのだ…。

sevenspark SAYS
I believe they are two separate things. For the visual editor you’re adding TinyMCE buttons. For the HTML editor you’re adding “quick tags”.

It looks like it’s pretty simple to extend according to this post: http://scribu.net/wordpress/right-way-to-add-custom-quicktags.html

Otherwise, dissecting this plugin might help http://wordpress.org/extend/plugins/post-editor-buttons/screenshots/

こういうことね:

ふぅ、やっと入り口に立てた…。