Skip to content

Instantly share code, notes, and snippets.

@mboynes
Created January 11, 2013 22:12
Show Gist options
  • Save mboynes/4514406 to your computer and use it in GitHub Desktop.
Save mboynes/4514406 to your computer and use it in GitHub Desktop.
WP & TinyMCE Styles Dropdown
<?php
/**
* Customize TinyMCE -- Add styles dropdown and add some custom styles. Selecting the style will add a class to the element.
*
**/
function my_tinymce_styles( $init ) {
$init['theme_advanced_buttons2_add_before'] = 'styleselect';
$init['theme_advanced_styles'] = 'Top Right Inset=insettop,Left Inset=insetleft,Right Inset=insetright';
return $init;
}
add_filter( 'tiny_mce_before_init', 'my_tinymce_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment