Last active
October 21, 2016 08:14
-
-
Save Mahjouba91/d0d1d0188d623e22fc92b8414146bafa to your computer and use it in GitHub Desktop.
Custom tinyMCE Style
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
<?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