Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
Using TinyMCE with WordPress. Multiple editors on the same page. tinymce.editors array is empty if editors were loaded in text mode

I'm using TinyMCE with WordPress. I need it as a part of my custom WordPress plugin. So there is a page containing multiple TinyMCE editors, each with different ID. Each of them was created with wp_editor() function. When user performs an action like clicking the button I want to set content of the particular editor using tinymce.get("exampleID").setContent(). That works fine as long as TinyMCE was loaded in Visual Mode. Like there are 2 modes: visual and text.

When user changes to the text mode, leaves the page and come back later these TinyMCE editors will try to load in the text mode instead of visual one. But here is my problem: if these editors are loaded in text mode these are not in the tinymce.editors array and using tinymce.get() will result with javascript error saying it's null. If user switches back to visual mode, that particular editor will appear in the tinymce.editors array. So user needs to switch each of editors back to visual mode so these will be pushed to tinymce.editors array.

Currently I just hide the toggle mode buttons but I would know if there is any solution for that.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!