Skip to content

Instantly share code, notes, and snippets.

@Mahjouba91
Last active October 21, 2016 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mahjouba91/d0d1d0188d623e22fc92b8414146bafa to your computer and use it in GitHub Desktop.
Save Mahjouba91/d0d1d0188d623e22fc92b8414146bafa to your computer and use it in GitHub Desktop.
Custom tinyMCE Style
<?php
add_filter( 'tiny_mce_before_init', 'add_frame_style' );
/*
* Add the new tinyMCE style
*/
public static function add_frame_style( $params ) {
$style_formats = json_decode( $params['style_formats'] );
$style_formats[] = array(
'title' => 'Notes',
'block' => 'div',
'classes' => 'post-notes',
'wrapper' => true
);
$params['style_formats'] = json_encode( $style_formats );
return $params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment