WordPress.org

Ready to get started?Download WordPress

Forums

TinyMCE integration on a plugin (2 posts)

  1. UnPointZero
    Member
    Posted 3 years ago #

    Hi,

    I've done a small plugin for a website to add some specific content.
    On my plugin admin panel, I'm using TinyMCE to display textareas.
    My problem is that TinyMCE doesn't generate proper HTML code.
    For exemple, it doesn't add <p></p> automatically and when I underline something, it just add <span> </span> around the text.

    Here's my action to load tinymce :

    add_action('admin_print_scripts', 'do_jslibs' );
    
    function do_jslibs()
    {
    	wp_enqueue_script( 'common' );
    	wp_enqueue_script( 'jquery-color' );
    	wp_print_scripts('editor');
    	if (function_exists('add_thickbox')) add_thickbox();
    	wp_print_scripts('media-upload');
    	if (function_exists('wp_tiny_mce')) wp_tiny_mce();
    	wp_admin_css();
    	wp_enqueue_script('utils');
    	do_action("admin_print_styles-post-php");
    	do_action('admin_print_styles');
    }

    Any ideas ?

    Thanks !

  2. UnPointZero
    Member
    Posted 3 years ago #

    Ok problem resolved... it's not TinyMCE it's a bug with another function :P.

    BTW this code works well if you want to use TinyMCE in your plugins !
    the_editor('your text','textarea name'); to display tinymce :)

    C ya!

Topic Closed

This topic has been closed to new replies.

About this Topic