Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable language switch for text widget #1042

Merged
merged 37 commits into from
Aug 4, 2021
Merged

Enable language switch for text widget #1042

merged 37 commits into from
Aug 4, 2021

Conversation

herrvigg
Copy link
Collaborator

@herrvigg herrvigg commented Jun 26, 2021

The text widget was broken since 2017 though the main issue was raised in 2018: #616.

It is a very complex feature to restore due to the way the widgets are updated in javascript with many dynamic behaviors and "internal" WP sync fields: https://make.wordpress.org/core/2017/05/23/addition-of-tinymce-to-the-text-widget/

There are several situations to handle:

  • existing widget initialized with pre-loaded content
  • widget updated (save button)
  • widget added with or without existing switching buttons on the page.

This major rework of the text widget in qTranslate-XT requires several changes in the JS API with new functions exposed:

  • attachContentHook
  • attachEditorHook (*)
  • setupLanguageSwitch

(*) attachEditorHook is renamed from setEditorHooks but normally third-party code should rather use loadAdditionalTinyMceHooks() for standard TinyMCE hooks.

@herrvigg herrvigg added the core Core functionalities, including the admin section label Jun 26, 2021
@herrvigg herrvigg changed the title Enable language switch for text widget and widget titles Enable language switch for text widget Jun 27, 2021
@Hr0bar
Copy link

Hr0bar commented Aug 2, 2021

Hi herrvigg, thanks again for this work, when can we expect this to be released?

@herrvigg
Copy link
Collaborator Author

herrvigg commented Aug 3, 2021

I was about to merge this but WP has released a new feature in WP 5.8 to manage the widgets... with Gutenberg.
Hopefully there's a new plugin "Classic Widgets" which disable this feature. It's very simple, by adding two filters, but I need to check this better and possibly do a similar workaround with Gutenberg using a single language mode.

@herrvigg
Copy link
Collaborator Author

Released in 3.11.0.

@herrvigg herrvigg deleted the fix/widget branch August 28, 2021 22:25
@herrvigg herrvigg mentioned this pull request Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionalities, including the admin section
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants