Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Howdy_McGee on "Adding Styles to TinyMCE 4.0 (WP 3.9)"

$
0
0

With the introductions of TinyMCE 4.0 comes a new, nice Format Select which has a few categories:

Headers
- Header 1 through Header 6
Inline
- Bold through Code
Blocks
- Paragraph through Pre
Alignment
- Left through Justify

What I want to do is add a Classes Menu at the bottom (below the Alignment menu) which I can stack classes in the submenu. If I use the old fashion method:

$style_formats = array(
	array(
		'title' => '.large',
		'block' => 'p',
		'classes' => 'large',
		'wrapper' => false,

	)
);
$in['style_formats'] = json_encode( $style_formats );

The above will override everything inside my formats menu. If I print out the variable $in - style_formats doesn't exist - formats on the otherhand does exist, but as a string. I tried to json_decode it but it was no use.

How do I add a "Classes" menu appeneded to the pre-existing formats?


Viewing all articles
Browse latest Browse all 8245

Trending Articles