WordPress.org

Ready to get started?Download WordPress

Forums

TinyMCE Advanced
tinyMCE.activeEditor.getContent(content) does not work with TinyMCE Advanced (3 posts)

  1. giorgio79
    Member
    Posted 2 years ago #

    Hello,
    Fellow dev here.
    With the plain WP installation I am able to retrieve the post content with this tinyMCE.activeEditor.getContent(content), with TinyMCE Advanced activeEditor is set to null, any tips why, and how I could get the content with jquery inside the post?

    Cheers,
    Gyuri

    http://wordpress.org/extend/plugins/tinymce-advanced/

  2. giorgio79
    Member
    Posted 2 years ago #

    Ah found it, this plugin puts content inside
    jQuery("#content").html();

  3. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 2 years ago #

    The activeEditor is null if TinyMCE is not initialized yet. It is also hidden ed.isHidden() when the user switches to the HTML editor. jQuery("#content").html(); or jQuery("#content").val(); would get the content from the textarea, the content in the iframe may be newer/changed.

    If you're trying to get the content from either MCE or the HTML editor, will need to check if MCE is hidden, if yes -> get the content from the textarea, if no -> run `ed.save()' to get the content http://www.tinymce.com/wiki.php/API3:method.tinymce.Editor.save

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic