• Hey all,

    I have been having problems getting this to work. I am using WP 2.6.2. I have added a theme page in order to create a page to manage a static table on my website. The theme page addition works fine. What I’m having problems with is getting the WYSIWYG editor to appear — only the HTML editor will come up. When I click on “Visual” nothing happens. Here is the code I’m using:

    wp_enqueue_script('post');
    	if ( user_can_richedit() ) { wp_enqueue_script('editor'); }
    	add_thickbox();
    	wp_enqueue_script('media-upload');
    	wp_enqueue_script('word-count');
    
    	?>
    
    	<div class="wrap">
    
    <div id="postdivrich" class="postarea">
    	<h2>Front Content Settings</h2>
    	<form method="post">
    	<h3><label for="content">Edit Front Content</label></h3>
    	<?php the_editor($updated_value, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2); ?>
    	<p><div class="submit"><input type="submit" name="save_front_content_options" value="<?php _e('Save Options', 'save_youtuber_options') ?>"  style="font-weight:bold;" /></div></p>
           </form>
    </div>

    The function user_can_richedit() returns true.

    Can anybody see what I need to do in order to get the “Visual” editor working correctly?

    Thanks,
    Ryan

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think there’s a bug with the editor if you’re loading it in a custom setting. For example, I’m trying to load it with a different name and it goes wonky. If anyone finds a solution please do share it. ??

    datafeedr

    (@datafeedrcom)

    im also having the exact same issues…

    webaholic

    (@webaholic)

    I got that one working for me… but only with a little hack.

    I did the following:
    init function:

    wp_enqueue_script( 'word-count' );
    wp_enqueue_script('post');
    if ( user_can_richedit() )
      wp_enqueue_script('editor');
    wp_enqueue_script('thickbox');
    wp_enqueue_script('media-upload');

    admin panel:

    <div id="poststuff">
    <div id="titlediv">
    <div class="inside">
    <h3 id="title">Titel</h3>
    <div id="edit-slug-box">&nbsp;</div>
    </div>
    </div>
    <div id="postdivrich" class="postarea">
    <?php the_editor($partner->desc, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2); ?>
    </div>
    </div>

    And in the post.js (you’ll find it in wp-admin/js) the function tag_update_quickclicks() needs to be changed.
    Wrap its content in:

    if(jQuery( '#tags-input' ).length) {
    ...
    }

    While I have to say the only thing which didn’t work without that last hack was the media buttons. (You’d get the popup, but you won’t be able to select any image (uploading was ok, but wasn’t worth bandwith when you could not use the image later).

    Maybe this will help someone to figure out a way for him/herselfe…

    I got this working using this method:

    How-To include tinyMCE in your WP plugin

    Everything works, including the image uploader – One important note that stole 3 hours of my life: The user must have “Use Visual Editor” checked!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Calling visual editor via the_editor() from a custom page doesn’t work’ is closed to new replies.