Skip Navigation

[Resolved] added custom styles to custom fields

This support ticket is created 2 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 9 replies, has 4 voices.

Last updated by ricoF 2 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2405933
Schermafbeelding 2022-06-27 om 11.21.43.png
Schermafbeelding 2022-06-27 om 11.20.33.png

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

#2406051

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please share with what version exactly it used to work and it broken with the latest Types?

Have you tried to clear the server and browser cache and check if that help you to resolve the issue.

#2406077

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

#2407657

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've escalated issue to our Devs and they will look in to it as soon as possible, please hold on until further updates.

#2407661

Thank you Minesh,
I'll hold on!
Best
Ineke

#2408431

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

changing the ticket status, I will get back to you as soon as I've any update on this issue.

#2449337

Hello,
Any updates on this issue?
Best
Ineke

#2451567

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

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.

#2486889

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

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.

Or you can download the latest versions from your accounts page: https://toolset.com/account/downloads

#2486935

thank you for the update. It works great.