it is possible to method to add tinymce into my very own wordpress wordpress plugin? i have got a textarea during my after sales script and wish to get this to area right into a tinymce wysiwyg editable area.

it is possible to method of doing that?

wysiwyg

edit

<?php

    wordpress_small_mce(false,array("editor_selector" => "test"))

?>

<textarea class="test" id="test" title="test"></textarea>

doesn't work for me personally

js error is much like mceerror

also

<textarea class="theEditor" id="videogalerie-add_description" title="videogalerie-add_description"></textarea> didn't work

The next example works best for me. Just make certain to make use of the id from the textarea you need to choose within the $a["elements"] variable.

Presuming you've got a textarea using the id of 'intro':

// attach the small mce editor for this textarea

if (function_is available('wp_small_mce')) wordpress_theme"

    $a["height"] = "200"

    $a["width"] = "800"

    $a["onpageload"] = ""

    $a["mode"] = "exact"

    $a["elements"] = "intro"

    $a["editor_selector"] = "mceEditor"

    $a["plug ins"] = "safari,inlinepopups,spellchecker"

    $a["forced_root_block"] = false

    $a["pressure_br_newlines"] = true

    $a["pressure_p_newlines"] = false

    $a["convert_newlines_to_brs"] = true

    return $a'))

 wordpress_small_mce(true)



?>

Camden already clarified this, but just in case somebody needs the entire code... Make sure to hook in admin_mind, connecting into admin_enqueue_scripts will make it load before other scripts, for example jQuery, so it won't work.

add_action("admin_mind","load_custom_wordpress_small_mce")

function load_custom_wordpress_small_mce() is available('wp_small_mce')) wordpress_theme"

    $a["height"] = "200"

    $a["width"] = "800"

    $a["onpageload"] = ""

    $a["mode"] = "exact"

    $a["elements"] = "intro"

    $a["editor_selector"] = "mceEditor"

    $a["plug ins"] = "safari,inlinepopups,spellchecker"

    $a["forced_root_block"] = false

    $a["pressure_br_newlines"] = true

    $a["pressure_p_newlines"] = false

    $a["convert_newlines_to_brs"] = true

    return $a'))

 wordpress_small_mce(true)





Then somewhere inside your template place a normal textarea:

<textarea id="intro"></textarea>

Following guides from here and there (found because of this), here's how I have handled to create something focus on wordpress 3..5 :

<?php

add_action("admin_print_scripts", "js_libs")

function js_libs() wordpress_enqueue_script('tiny_mce')



wordpress_small_mce( false , // true helps make the editor "tiny"

    array(

        "editor_selector" => "tinymce_data"

    )

)

?>

<script type="text/javascript">

    jQuery(document).ready(function($) )

        $('a.toggleHTML').click(function() )

    )

</script>

<form method="publish" action="">

<ul>

  <li>

    <span id="submit"><input class="button" type="submit"></span>

    <p id="toggle" align="right"><a class="button toggleVisual">Visual</a><a class="button toggleHTML">HTML</a></p>

  </li>

  <li><textarea style="width:100%" class="tinymce_data" id="tinymce_data" title="tinymce_data"></textarea></li>

</ul>

</form>

Ok, which means this publish did not appear that will help you. I performed around by using it some and first got it working with the addition of individuals following class towards the textarea: class="theEditor"