Skip to content

Instantly share code, notes, and snippets.

@bryanwillis
Forked from xymox12/functions.php
Created March 24, 2014 18:29
Show Gist options
  • Save bryanwillis/9746202 to your computer and use it in GitHub Desktop.
Save bryanwillis/9746202 to your computer and use it in GitHub Desktop.
Tinymce toolbars for different post types
/* Tiny MCE Modifications */
function myformatTinyMCE($in) {
$style_formats = array(
array(
'title' => 'First paragraph',
'selector' => 'p',
'classes' => 'standFirst'
)
);
global $post_type;
// var_dump($post_type);
if( 'fellow' == $post_type ) {
$in['theme_advanced_blockformats'] = 'p,h3,h4,h5,h6';
} else {
$in['theme_advanced_buttons1_add'] = 'styleselect';
$in['style_formats'] = json_encode($style_formats);
$in['theme_advanced_blockformats'] = 'p,h2,h3,h4,h5,h6';
}
return $in;
}
add_filter('tiny_mce_before_init', 'myformatTinyMCE');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment