I’m writing a WordPress plug-in that requres user input, so I thought I’d try and use the default WordPress rich-text-editor. Firstly so as not to have to include a text editor in my plug-in when WordPress already has one, and secondly so it’s more seamless for the user.
I literally just want the default editor, nothing changed or customised about it.
The problem is, I can’t get it to work without errors, and there is little to no documentation on the the_editor()
function.
At the moment I have this where my textbox should be:
<?php
the_editor( $content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2 );
?>
And the editor appears, but with errors. For example the Visual/HTML looks broken, and the media buttons do nothing. I mean, you click them and nothing happens.
Since this was posted, the wp_editor() function has been created. This is the correct way to include TinyMCE in a theme or plugin. Better yet, its Codex page (linked above) is much better and there are some pretty good tutorials out there.