-
AuthorPosts
-
September 7, 2020 at 2:48 pm #1243997
Hi,
Maybe you guys can help me with an issue I have in a translation plugin which uses the classic editor interface.
The issue is this: WP’s annoying autop function keep adding <p> tags randomly around the Enfold code visible in the translation window (Text view). The normal filters I used before don’t seem to work anymore:remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' );
I’ve read that for Gutenberg they have now added the new autop function via javascript.
So here’s my question: can you let me know how you get around the autop issues in your ALB editor?
Then maybe that solution can be ported to my situation.
Thanks,
RobSeptember 10, 2020 at 7:47 am #1244766Hey Rob,
Thank you for the inquiry.
The wpautop function is used in many shortcodes or templates in the builder such as the text block, so it is possible this is why the paragraph tags are added automatically in the translation.
Which plugin are you using? Please post a screenshot of the translation editor, or post the login details in the private field so that we could check it.
Best regards,
IsmaelSeptember 10, 2020 at 9:35 am #1244800Hi Ismael,
Thanks for your time with this. I have put some info in the private field with a temp login.
The translation process is still a work in progress, which is why I prefer to put the details in private. I also realise I did not phrase my question very well :-)The real question is this:
From what I understand autop and texturize should only apply on the frontend. So the <p> tags should not be showing in the Classic Editor in Text view?
In fact that is the way it is in Text View in the Posts (non-ALB) and in the ALB editor, for example the Home Page (1 avia element at a time).
Yet on the translation window (Classic Editor) the <p> tags appear when switching to Visual view and then back to Text view.So is this just an issue of needing to use get_the_content instead of the_content in the plugin?
And would there be any issues with Enfold if the translation editor window used get_the_content instead or some filters to make it raw?Thanks for your help,
Rob- This reply was modified 4 years, 2 months ago by rob2701. Reason: added note about possible performance problems hosting live site
September 14, 2020 at 4:04 am #1245590Hi,
Thank you for the update.
From what I understand autop and texturize should only apply on the frontend. So the tags should not be showing in the Classic Editor in Text view?
Are you talking about the TinyMCE editor in the Translate Posts panel? This editor is created by the plugin, so it has its own configuration which is not controlled or can be influenced by the theme.
If the filter above is not working for the translation editor, try this plugin to toggle the wpautop settings of the text editor.
// https://wordpress.org/plugins/toggle-wpautop/
If the plugin doesn’t work, use the tiny_mce_before_init filter to adjust the options of the tinymce or ask the plugin author to disable wpautop for the translation editor manually.
Best regards,
IsmaelSeptember 14, 2020 at 6:45 am #1245659Hi Ismael,
Thank you for taking a look and for the advice, very useful and helpful. It must be the tinymce option, because the plugin to toggle wpautop did not work. I (wrongly) assumed that the translation window was also Classic Editor.
You’re a star!You can close this, thanks,
RobSeptember 14, 2020 at 7:06 am #1245662Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘enquiry about WP autop function’ is closed to new replies.