Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ryanburnette/5745431 to your computer and use it in GitHub Desktop.
Save ryanburnette/5745431 to your computer and use it in GitHub Desktop.
<?php
// Set Special Formats in TinyMCE
function ts_beforemce( $settings ) {
$style_formats = array(
array(
'title' => 'Button',
'selector' => 'a',
'classes' => 'button'
)
/*
array(
'title' => 'Callout Box',
'block' => 'div',
'classes' => 'callout',
'wrapper' => true
),
array(
'title' => 'Bold Red Text',
'inline' => 'span',
'styles' => array(
'color' => '#f00',
'fontWeight' => 'bold'
)
)
*/
);
$settings['style_formats'] = json_encode( $style_formats );
return $settings;
}
//add_filter('tiny_mce_before_init', 'ts_beforemce');
function ts_buttons( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
//add_filter('mce_buttons_2', 'ts_buttons');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment