1

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

  • 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
2

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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