CKEditor for WordPress
[resolved] Adding Custom Plugins / Buttons to CKEditor 4.0 WordPress 3.5 Toolbar (6 posts)

  1. own3mall
    Posted 3 years ago #

    Hi All,

    I tried following these guides to add custom buttons to the CKEditor toolbars that perform custom functions.

    I followed these guides and all attempts failed:




    Is there any easy way to add buttons in CKEditor 4.0 paired with WordPress 3.5? Have the steps changed that the guides mention? I've tried so many things. Any help is greatly appreciated.


  2. msrosyidi
    Posted 3 years ago #

  3. solagirl
    Posted 3 years ago #

    @own3mall Hey, I think what you mentioned are dealing with how to create ckeditor plugins or add a plugin in the ckeditor way. But to add buttons to CKEditor For WordPress plugin's toolbar, you need to use the WordPress way.

    There are two filters you can use to load your custom ckeditor plugin and button.
    ckeditor_external_plugins - load custom plugins
    ckeditor_buttons - load custom buttons

    Use them together you can add your plugin, here is an example. But beware that this only adds buttons to the editor in back end. It can't change anything for comment area editor. To modify the comment editor, it's better to use ckeditor.config.js in my opinion.

    add_action('init', 'custom_ckeditor_interface');
    function custom_ckeditor_interface(){
    	add_filter( 'ckeditor_external_plugins', 'register_custom_ckeditor_plugins' );
    	add_filter( 'ckeditor_buttons', 'register_custom_ckeditor_buttons' );
    //Load external ckeditor plugins
    function register_custom_ckeditor_plugins( $plugins ){
    	$plugins['your_plugin_name_1'] = 'your_plugin_uri_1';
    	$plugins['your_plugin_name_2'] = 'your_plugin_uri_2';
    	return $plugins;
    //Add more buttons
    function register_custom_ckeditor_buttons( $buttons ){
    	$buttons[] = array('button_1');
    	$buttons[] = array('button_2');
    	return $buttons;

    The plugin name and button name are defined in your ckeditor plugin scripts(eg. plugin.js)

  4. own3mall
    Posted 3 years ago #

    Hey Solagirl,

    I tried a variant of your solution, and it didn't work. My buttons didn't show up.

    Here's what I have:

    In ckeditor_wordpress.php:

    [Large code excerpt removed by moderator per forum rules. Please use the pastebin for all large code excerpts. It works better anyway.]

    The buttons don't show up. Any idea why? This is really frustrating!

  5. own3mall
    Posted 3 years ago #

    Forget my last post.

    I actually noticed that using the HTMLButtons plugin works fine for the comments, but I need this button in the full post editor.


    So again, the basic works fine, but how do I add button1, button2, button3 to the full editor?

  6. own3mall
    Posted 3 years ago #

    I finally got it to work. I followed this blog:


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • CKEditor for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic