WordPress.org

Ready to get started?Download WordPress

Forums

TinyMCE Anchor Button in Editor? (8 posts)

  1. Scott Buehler
    Member
    Posted 4 months ago #

    This functions.php code used to work:
    //* Add buttons to WP Editor
    function enable_more_buttons($buttons) {
    $buttons[] = 'anchor';

    return $buttons;
    }
    add_filter("mce_buttons", "enable_more_buttons");

    However, it no longer works. The anchor button doesn't appear in the editor after upgrading. I checked the TinyMCE site and can't find anything referencing a change to "anchor" to all the anchor button into the editor.

  2. Scott Buehler
    Member
    Posted 4 months ago #

    $buttons[] = 'backcolor';
    That works. The anchor button doesn't work in 3.9. Is this a bug?

    WP Edit plugin works to add the button in for now. I don't like running plugins that can be function.php applied, but until I can get this working...

  3. immw
    Member
    Posted 4 months ago #

    I'm having this issue too, would be interested if anyone can see a fix. Probably related so will mention on this thread, 'replace' doesn't work either.

    Can't find any documentation on TinyMCE's site for v4 buttons like there is for v3

  4. Houfton
    Member
    Posted 3 months ago #

    I cannot get 'anchor' to work either, though other buttons do. I have noticed that some names have changed (sub = subscript, justifyfull = alignjustify etc.) but not 'anchor' according to this list TinyMCE 4 buttons / controls.

  5. vtxyzzy
    Member
    Posted 3 months ago #

    Try using the TinyMCE Advanced plugin. That way you will have the same buttons in all themes.

  6. ygirod
    Member
    Posted 2 weeks ago #

    I wouldn't like to install a plugin just for an anchor button.

    Any new idea ?

  7. vtxyzzy
    Member
    Posted 2 weeks ago #

    That plugin offers much more than an anchor button. It also provides table maintenance and 13 other functions, plus the ability to rearrange the icons into a more logical grouping.

  8. jaschu
    Member
    Posted 1 week ago #

    I found a great answer here: http://wordpress.stackexchange.com/a/158546/58473 but I'll try to sum up. That answer from mrwweb helped me a lot.

    Not all plugins for TinyMCE are installed in the base WP codebase. You'll have to get the anchor button javascript by downloading the full TinyMCE package ( http://www.tinymce.com/download/download.php right now ) and from the downloaded, unzipped folder, grab: js/tinymce/plugins/anchor. You could install it in /wp-includes/js/tinymce/plugins/anchor in your WP installation, but it could get overwritten when you upgrade WordPress, so either place those js files in the theme you're using, or roll it up in a plugin.

    The $buttons[] = 'anchor'; line you've added is correct, keep it. What's now missing is something like this:

    function my_mce_external_plugins($plugins) {
        $plugins['anchor'] = 'where-you-put-that-folder/js/tinymce/plugins/anchor/plugin.min.js';
        return $plugins;
    }
    add_filter('mce_external_plugins', 'my_mce_external_plugins');

Reply

You must log in to post.

About this Topic