2
是否可以指定按鈕在編輯器工具欄上的顯示位置(首位,最後一位)?也許通過傳遞一個可選參數?TinyMCE按鈕插入順序
function add_tinymce_button() {
if (! current_user_can('edit_posts') && ! current_user_can('edit_pages'))
return;
if (get_user_option('rich_editing') == 'true') {
//the function that adds the javascript
add_filter('mce_external_plugins', array(&$this,'add_new_tinymce_plugin'));
//adds the button to the tinymce button array
add_filter('mce_buttons', array(&$this,'register_new_button'));
}
}
/*
* add the new button to the tinymce array
*/
function register_new_button($buttons) {
array_push($buttons, $this->btn_arr["Seperator"],$this->btn_arr["Name"]);
return $buttons;
}