Can't seem to get tiny_mce_before_init or paste_convert_word_fake_lists to work

I’m trying to disable paste_convert_word_fake_lists which is a feature of the TinyMCE Paste plugin included with WordPress.

I’m not sure if it’s due to the way Pro/Cornerstone is loading it or what’s up. It seems to disable in WP when editing a page but not when using Pro to edit a page.

Basically I’m copying text from a Google doc which is formatted in a way that looks like it’s a list but it isn’t actually a list. To reproduce it you would have to create a new Google doc and paste this in, then copy it from the Google doc into the Pro editor:

A. Item 1

B. Item 2

It should become a list in the editor. What I want to do is disable this behaviour which apparently can be done by setting paste_convert_word_fake_lists to false. https://www.tiny.cloud/docs/plugins/paste/#paste_convert_word_fake_lists

add_filter( 'tiny_mce_before_init', array( $this, 'disable_paste_convert_word_fake_lists' ) );

function disable_paste_convert_word_fake_lists( $init ) {
	$init['paste_convert_word_fake_lists'] = false;

	return $init;
}

Hello There,

Thanks for posting in! Because what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

After the child theme is set up, please add the following code in your child theme’s functions.php file

add_filter( 'tiny_mce_before_init', array( $this, 'disable_paste_convert_word_fake_lists' ) );

function disable_paste_convert_word_fake_lists( $init ) {
	$init['paste_convert_word_fake_lists'] = false;

	return $init;
}

Hope this helps. Please let us know how it goes.

Hmm, what you posted is 100% identical to what I posted.

Also, I think I figured it out. They’ve removed all actions and filters in \Cornerstone_App::prime_editor in an effort to prevent conflicts. However there exists an action cornerstone_before_wp_editor which I think I can tie into. Thanks!

Glad you were able to figure it out :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.