0
votes

I want to use TinyMCE in my WordPress plugin. I want to add TinyMCE editor for my custom textboxes and text areas.

I have tried including below code to load TinyMCE editor scripts. wp_enqueue_script( 'tiny_mce');

But this does not load TinyMCE editor in my admin page. When I init TinyMCE it gives me error as TinyMCE is not defined.

Could anyone here know how to load TinyMCE scripts on my admin page?

1

1 Answers

1
votes

The WordPress default wp_editor() function renders an editor in a page in the typical fashion used in Posts and Pages.

You can use it like

$content = ''; // Initial content for the editor
$editor_id = 'editor_id'; //HTML id attribute value for the textarea and TinyMCE
wp_editor( $content, $editor_id );

check here