I am trying to: add custom styles to the wysiwyg editor
I expected to see: the styles that I added in functions.php (screenshot with "lees ook" etc)
Instead, I got: general styles (screenshot with "Koppen" etc)
This is what I added to my functions.php:
function my_mce_buttons_2( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );
function my_mce_before_init_insert_formats( $init_array ) {
$style_formats = array(
array(
'title' => 'lees ook',
'inline' => 'span',
'classes' => 'groen',
'wrapper' => true,
),
//more arrays. I left them out to keep things compact
);
$init_array['style_formats'] = json_encode( $style_formats );
return $init_array;
}
add_filter( 'tiny_mce_before_init', 'my_mce_before_init_insert_formats' );
It used to work just fine in bothe the content field and the custom fields. After the last update it stopped working for the editor of custom fields. It still works fine in the content field of custom post types.
Is there any way to solve this? I hope you can help!
Best,
Ineke
Hello Minesh, Thank you for getting back to me.
Yes I did try the clearing of site cache and browser cache. That didn't solve the issue.
It still worked in Types version 3.4.14.
It doesn't work anymore in version 3.4.16.
To be honest I do not know if it worked 3.4.15. I could test this for you if necessary on my local server.
Best,
Ineke
I checked the internal ticket and I can see there is no update yet. It suppose to get added with our next development cycle but there is no ETA on it as of now.
A quick update to let you know Types 3.4.17 has been released which includes a fix for this issue.
If the updates do not show up on your plugin installer page (click the registered link beneath the plugin name to go to the custom installer page) click the the Check for Updates button to update the list.