• I want to add a button and corresponding features into TinyMCE editor in wordpress, but a lot of hooks has changed in 3.3.1

    any idea?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter castielgrant

    (@castielgrant)

    the code bellow seems not working anymore

    function enable_more_buttons($buttons) {
    $buttons[] = ‘hr’;
    $buttons[] = ‘fontselect’;
    $buttons[] = ‘sup’;

    // etc, etc…

    return $buttons;
    }
    add_filter(“mce_buttons”, “enable_more_buttons”);

    Thread Starter castielgrant

    (@castielgrant)

    this is not working too

    function myplugin_addbuttons() {
    // Don’t bother doing this stuff if the current user lacks permissions
    if ( ! current_user_can(‘edit_posts’) && ! current_user_can(‘edit_pages’) )
    return;

    // Add only in Rich Editor mode
    if ( get_user_option(‘rich_editing’) == ‘true’) {
    add_filter(“mce_external_plugins”, “add_myplugin_tinymce_plugin”);
    add_filter(‘mce_buttons’, ‘register_myplugin_button’);
    }
    }

    function register_myplugin_button($buttons) {
    array_push($buttons, “separator”, “myplugin”);
    return $buttons;
    }

    // Load the TinyMCE plugin : editor_plugin.js (wp2.5)
    function add_myplugin_tinymce_plugin($plugin_array) {
    $plugin_array[‘myplugin’] = URLPATH.’tinymce/editor_plugin.js’;
    return $plugin_array;
    }

    // init process for button control
    add_action(‘init’, ‘myplugin_addbuttons’);

    I want to find out too, please, if anybody has a solution.

    I need to add a new button to tinimce, with a custom style.

    And another related question: the style I’m adding should it be in the tiniymce css file or my theme’s css file?

    Thanks!

    I have found this on WP Codex.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘adding new button and features into TINYMCE under wordpress3.3’ is closed to new replies.