Inserting text in WordPress tinymce

/ Published in: JavaScript
Save to your folder(s)

This piece of code allows to insert text into the tinymce textarea when writing a WordPress plugin for instance.

Copy this code and paste it in your HTML
  1. // Just replace TextToAdd by text or html code
  3. tinyMCE.execCommand('mceReplaceContent',false,TextToAdd);

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.