-
-
Save coderaaron/7172138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add style selector drop down | |
function my_mce_buttons_2( $buttons ) { | |
array_unshift( $buttons, 'styleselect' ); | |
return $buttons; | |
} | |
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' ); | |
// customize the MCE editor | |
function aah_customize_mce( $init ) { | |
/* Only include these tags */ | |
$init['theme_advanced_blockformats'] = 'h2,h3,h4,p'; | |
/* Remove these buttons */ | |
$init['theme_advanced_disable'] = 'forecolor, underline, justifyfull, indent, outdent'; /* | |
/* Set up your custom style classes */ | |
$style_formats = array( | |
array( | |
'title' => 'Intro Paragraph', | |
'selector' => 'p', | |
'classes' => 'lead' | |
), | |
); | |
/* Only include your custom styles -- defined above -- in your style dropdown */ | |
$init['style_formats'] = json_encode( $style_formats ); | |
return $init; | |
} | |
add_filter('tiny_mce_before_init', 'aah_customize_mce'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment