I want to adda tinymce editor dynamically using jQuery on wordpress backend in custom post type.
For this I have add following script:
var content = '<textarea class="custom-meta-box-textarea" rows="20" autocomplete="off" cols="40" name="custom-meta-box-text" id="custom-meta-box-editor"></textarea>';
jQuery('#custom_section').append(content);
var eid = 'custom-meta-box-editor;
tinymce.execCommand('mceAddEditor', false, eid);
switchEditors.go(eid, 'tmce');
It is working and add tinymce editor to textarea, but when I save post then it conflict another editor on custom post page, and after that nothing save.
Is there any script which is missing?
Is there another method to add editor using jQuery?