Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda