Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

Example here

share|improve this question
    
You can shorten that function a lot, like so: the_editor( $content, 'content', 'title', true, 2 ); -- so long as $content is defined. –  Jared May 29 '12 at 22:53

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.