• Hi All,

    I can’t post directly in wp-advanced so I am posting here.

    What I am trying to do is get the_editor() aka wordpress’s tinyMCE embedded into a non admin area, in this case a page.

    This is to allow contributors to create UGC (User generated content) without accessing the admin screen, keeping the process as simple as possible.

    It seems however the documentation surrounding the_editor() function call is lacking, and does not include a complete list of scripts & css files that must be loaded in order for the editor to work outside of an admin area (where people are just assuming that the css/js is already loaded).

    Any help would be greatly appreciated.

    Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter d.busby

    (@dbusby-1)

    Example:

    add_filter('wp_head','ugc_content');
    
     function ugc_content(){
    	wp_admin_css('thickbox');
    	wp_enqueue_script('post');
    	wp_enqueue_script('editor');
    	wp_enqueue_script('editor-functions');
    	add_thickbox();
    	wp_enqueue_script('media-upload');
    	wp_enqueue_script('jquery');
    	wp_enqueue_script('jquery-ui-core');
    	wp_enqueue_script('jquery-ui-tabs');
    	wp_enqueue_script('tiny_mce');
     }
    
    ....
    
    <?php if ( current_user_can('edit_posts') ) : ?>
        <div id="postrichdiv" class="postarea">
    	<?php the_editor(''); ?>
        </div>
    <?php endif; ?>

    The above will include the editor, with javascript errors, such as switchEditors not defined, also it will not render correctly so I am assuming another CSS file is required to be included.

    Thread Starter d.busby

    (@dbusby-1)

    ** bump **

    Hi d.busby

    I have the similar problem with you. It give me an error as “switchEditors not defined”

    And the css seems not work.
    Have you solved it yet?

    Glad to see I’m not the only one with this issue. I as well wanted to embed the tinyMCE editor into the pages to create a quick simple way to add or edit posts without going to admin. Similarly, using the_editor() I get the html editor without the proper css applied and a click on visual pops up a “switchEditors not defined”. Hopefully someone has a solution for this?

    This doesn’t work for calling it from the wordpress front end. I just get call to undefined function when I use this code

    <?php
       wp_tiny_mce( false , // true makes the editor "teeny"
           array(
               "editor_selector" => "reply_content"
           )
       );
    	?>

    from within a wordpress page (trying to get rich text replies).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘tinyMCE / the_editor() in a page’ is closed to new replies.