Skip to content

Instantly share code, notes, and snippets.

@ChrisLTD
Created May 24, 2011 14:27
Show Gist options
  • Save ChrisLTD/988801 to your computer and use it in GitHub Desktop.
Save ChrisLTD/988801 to your computer and use it in GitHub Desktop.
Modify TinyMCE in Wordpress to exclude buttons
/*
* Modifying TinyMCE editor to remove unused items.
*/
function customformatTinyMCE($init) {
// Add block format elements you want to show in dropdown
$init['theme_advanced_blockformats'] = 'p,h1,h2,h3,h4,h5,h6,div';
$init['theme_advanced_disable'] = 'justifyfull,pasteword';
$init['theme_advanced_buttons2_add'] = 'styleselect';
$init['theme_advanced_styles'] = 'Align Right=alignright, Align Left=alignleft';
return $init;
}
// Modify Tiny_MCE init
add_filter('tiny_mce_before_init', 'customformatTinyMCE' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment