Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
17
rated 0 times [  22] [ 5]  / answers: 1 / hits: 34164  / 14 Years ago, tue, may 18, 2010, 12:00:00

Is there a way to add TinyMCE into my own WordPress plugin?



I have a textarea in my back end script and want to make this area into a TinyMCE WYSIWYG editable field. Is there a way to do that?



wysiwyg



This code does not work for me:



<?php
wp_tiny_mce(false,array(editor_selector => test));
?>
<textarea class=test id=test name=test></textarea>


It shows the javascript error



f is undefined


Firebug screenshot:
TinyMCE



This didn't work either:



<textarea class=theEditor id=videogalerie-add_description name=videogalerie-add_description></textarea>

More From » php

 Answers
97

This is much easier to do in WordPress 3.3 using the wp_editor() function.



I'm working on a plugin that will add a TinyMCE instance to a theme options page. Here's what it looks like:



// Add TinyMCE visual editor
wp_editor( $content, $id );


Where $content is the stored content and $id is the name of the field. Options can also be passed to customize the TinyMCE functionality, check out the WordPress Codex for more details.


[#96756] Friday, May 14, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
katianatasham

Total Points: 293
Total Questions: 110
Total Answers: 103

Location: Saint Helena
Member since Mon, Jun 28, 2021
3 Years ago
katianatasham questions
Tue, Jul 20, 21, 00:00, 3 Years ago
Thu, Mar 18, 21, 00:00, 3 Years ago
Wed, Nov 25, 20, 00:00, 4 Years ago
Wed, Jun 24, 20, 00:00, 4 Years ago
Fri, May 15, 20, 00:00, 4 Years ago
;