Created
August 28, 2013 05:00
-
-
Save diegochavez/6362291 to your computer and use it in GitHub Desktop.
Wordpress: Useful code to modify the TinyMCE drop-down menu == reference: http://justintadlock.com/archives/2011/05/02/dealing-with-shortcode-madness#comment-335205
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
// Your should include this in to your functions theme | |
add_filter('mce_buttons_2', 'wpse3882_mce_buttons_2'); | |
function wpse3882_mce_buttons_2($buttons) | |
{ | |
array_unshift($buttons, 'styleselect'); | |
return $buttons; | |
} | |
add_filter('tiny_mce_before_init', 'wpse3882_tiny_mce_before_init'); | |
function wpse3882_tiny_mce_before_init($settings) | |
{ | |
$style_formats = array( | |
array('title' => 'Note', 'block' => 'p', 'classes' => 'note'), | |
); | |
$settings['style_formats'] = json_encode( $style_formats ); | |
return $settings; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment