WordPress.org

Support

Support » How-To and Troubleshooting » TinyMCE Anchor Button in Editor?

TinyMCE Anchor Button in Editor?

  • 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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • $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…

    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

    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.

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

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

    Any new idea ?

    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.

    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');
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘TinyMCE Anchor Button in Editor?’ is closed to new replies.
Skip to toolbar