• I used the code below:

    /**************************/
    /*  ADD BUTTONS TO EDITOR */
    /**************************/
    function enable_more_buttons($buttons) {
      $buttons[] = 'sub';
      $buttons[] = 'sup';
    
      return $buttons;
    }
    add_filter("mce_buttons_2", "enable_more_buttons");

    to add enable Subscript and Superscript buttons to the TinyMCE

    I also used:

    /* Add custom styles to the Styles drop down menu in the TinyMCE Editor
    ----------------------------------------------------------------------------------------*/
    add_filter( 'tiny_mce_before_init', 'ag_custom_tinymce_styles' );
    function ag_custom_tinymce_styles( $init ) {
    	$init['theme_advanced_buttons2_add_before'] = 'styleselect';
    	$init['theme_advanced_styles'] = 'Blue=blue,Grey=grey';
    	return $init;
    }
    add_filter('mce_css', 'my_editor_style');
    function my_editor_style($url) {
    
      if ( !empty($url) )
        $url .= ',';
    
      // Change the path here if using sub-directory
      $url .= trailingslashit( get_stylesheet_directory_uri() ) . 'css/editor-style.css';
    
      return $url;
    }

    To add a custom dropdown Styles menu to the editor.

    I just updated a site I’m developing to WordPress 3.9, and now neither of these functions work. Both items I added to the TinyMCE no longer show up.

    Anyone know what would need to be changed to make these work? I didn’t write these bits of code, I just found them from Tutorials, so I’m not entirely sure what some of these functions are doing, or how they work.

Viewing 1 replies (of 1 total)
  • Thread Starter jsites

    (@jsites)

    UPDATE:

    I found a comment on an article about the Superscript/Subscript buttons, and here’s the new code for it:

    /**************************/
    /*  ADD BUTTONS TO EDITOR */
    /**************************/
    function enable_more_buttons($buttons) {
      $buttons[] = 'subscript';
      $buttons[] = 'superscript';
    
      return $buttons;
    }
    add_filter("mce_buttons_2", "enable_more_buttons");

    sub had to be changed to subscript
    sup had to be changed to superscript

Viewing 1 replies (of 1 total)

The topic ‘3.9 Removed Custom Styles Dropdown from TinyMCE’ is closed to new replies.