[resolved] Adding tinyMCE Editor for custom field when editing post page (6 posts)

  1. guikubivan
    Posted 6 years ago #

    So after hours of trying to figure out the right way to add the tiny MCE editor to a custom box in the edit post page, I finally dived into the More Fields plugin to see how they do it and I hope they don't me posting this, but this is how:

    <script type="text/javascript">
    jQuery(document).ready(function() {
    if ( typeof( tinyMCE ) == "object" && typeof( tinyMCE.execCommand ) == "function" ) {
    tinyMCE.execCommand("mceAddControl", false, "textareaID");


    <textarea class="textareaID" name='textareaID' id='textareaID'>
    blah blah

  2. mackstar
    Posted 5 years ago #

    Thanks for that! Much appreciated, which file is the best to use this in to be unobtrusive when upgrading etc..



  3. Steve Taylor
    Posted 5 years ago #

    Thanks, saved me some time :) I had a problem initially using this with my own custom fields code, the paragraph formatting didn't seem to be retained on saving. What you need to do is run the submitted value through the wpautop function before writing it to the database. See line 214 of the more-fields-settings-object.php of the More Fields plugin...

  4. Alvaro
    Posted 5 years ago #

    Can you please explain a bit where to add those line.

  5. Rhand
    Posted 5 years ago #

    Going to give this a shot. Just wondering where to add/load the javascript..

  6. Rhand
    Posted 5 years ago #

    Well just loaded TinymCE for all text area fields. But the menu bar is way too big. Need to remove certain buttons. Any ideas how?

Topic Closed

This topic has been closed to new replies.

About this Topic