質問: 0; i < edbuttons.length; i++ ) { hedshowbuttons(edbuttons[i], i); } jquery("#ed_toolbar").append('<input type="button" id="ed_tabs" class="ed_button" title="enable and disable tabbing" value="disable tabs" />'); jquery("#ed_toolbar").append('<input type="button" onclick="fullscreen.on();" id="ed_fullscreen" class="ed_button" title="enable and disable fullscreen mode" value="fullscreen" />'); jquery("#ed_toolbar").append('<input type="button" id="ed_spell" class="ed_button" onclick="edspell(edcanvas);" title="' + quicktagsl10n.dictionarylookup + '" value="' + quicktagsl10n.lookup + '" />'); jquery("#ed_toolbar").append('<input type="button" id="ed_close" class="ed_button" onclick="edclosealltags();" title="' + quicktagsl10n.closeallopentags + '" value="' + quicktagsl10n.closetags + '" />'); }); </script> <?php }
回答: 私はそれを見つけました、wordpressは変更を加えました、そしてあなたは今簡単なapiを通してボタンを追加することができますif( !function_exists('_add_my_quicktags') ){ function _add_my_quicktags() { ?> <script type="text/javascript"> /* add custom quicktag buttons to the editor wordpress ver. 3.3 and above only * * params for this are: * string id required. button html id * string display required. button's value="..." * string|function arg1 required. either a starting tag to be inserted like "<span>" or a callback that is executed when the button is clicked. * string arg2 optional. ending tag like "</span>" * string access_key optional. access key for the button. * string title optional. button's title="..." * int priority optional. number representing the desired position of the button in the toolbar. 1 - 9 = first, 11 - 19 = second, 21 - 29 = third, etc. * string instance optional. limit the button to a specific instance of quicktags, add to all instances if not present.(optional) */ qtags.addbutton( 'php', 'php', '[ php gutter="false" ]', '[ /php]' ); qtags.addbutton( 'js', 'js', '[ js gutter="false"]', '[ /js]' ); qtags.addbutton( 'h2', 'h2', '< h2>', '< /h2>' ); qtags.addbutton( 'h3', 'h3', '< h3>', '< /h3>' ); qtags.addbutton( 'promt', 'prompt', function(){ qtags.insertcontent(window.prompt() ) }); </script> <?php } // we can attach it to 'admin_print_footer_scripts' (for admin-only) or 'wp_footer' (for front-end only) add_action('admin_print_footer_scripts', '_add_my_quicktags'); }