I have the following line of code:


which gives this error:

Uncaught TypeError: switchEditors.switchto is not a function

Searching around I found out that, due to changes to the core in WordPress 4.3, switchEditors.switchto() is not available/usable now.

Do you know how can I fix it?

You can see the complete code here.

  • Unfortunately support regarding third-party plugins is off-topic here. It looks like the plugin responsible has not been updated for six years, however - for security and compatibility's sake, it would be best to find an alternative.
    – bosco
    May 1, 2022 at 13:45
  • @bosco I agree it would be better to find an alternative instead of using a not supported theme. But it would be also interesting to find out the purpose of switchEditors.switchto() and how it was changed in latest versions of WordPress.
    – ᴜsᴇʀ
    May 2, 2022 at 8:04
  • 1
    It was a function which executed when the "Code"/"Visual" buttons were clicked in the old TinyMCE editor interface to affect the swap between editors. I believe it was replaced with switchEditors.switchEditor(). Here's the relevant file.
    – bosco
    May 2, 2022 at 19:33


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.