Is it possible to specify where a button appears (first, last) on the editor toolbar? Perhaps by passing an optional parameter?
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;
}
Yes, this is possible. There is a config option for the list of buttons called theme_advanced_buttons. Take a closer look. It is easy to use.