[wp-hackers] Customising distraction-free toolbar icons

Simon Blackbourn piemanek at gmail.com
Tue Oct 4 19:21:47 UTC 2011


I use the following code to customise which icons a client has available on
the TinyMCE toolbar:

add_filter( 'tiny_mce_before_init', array( $this, 'wysiwyg_defaults' ) );

function wysiwyg_defaults( $initArray ) {

        if ( ! current_user_can( 'use_wordpress_full_admin' ) ) {

            $initArray['theme_advanced_blockformats'] = 'p,h2,h3';

            $initArray['theme_advanced_buttons1'] =
'pastetext,|,|,formatselect,|,|,bold,italic,|,|,bullist,|,|,link,unlink,|,|,spellchecker,|,|,fullscreen';
            $initArray['theme_advanced_buttons2'] = '';
            $initArray['theme_advanced_buttons3'] = '';

            $initArray['spellchecker_languages'] = 'English=en';

        }

        return $initArray;

}

Is there any way I can specify default icons for the distraction-free mode
too? (currently I'm using CSS to hide a couple of unwanted buttons.)

Thanks
Simon


More information about the wp-hackers mailing list