[wp-hackers] Second editor instance

Alex Günsche ag.ml2008 at zirona.com
Thu Mar 20 09:22:27 GMT 2008


Hi,

I have the following problem:

I'm writing a plugin for WP 2.5 that inserts a second editor on the page
editing page, using the function the_editor(). The relevant code is:

--- SNIP ---
function spsi_editor()
{
  ?>
    <div id="spsi_editorcontainer" class="postarea">
      <h3><?php _e('Secondary content', 'spsi'); ?></h3>
      <?php the_editor($mystuff, 'spsi_content', 'content', true, 3); ?>
    </div>
  <?php
}
add_action('edit_page_form', 'spsi_editor');
--- SNIP ---

It looks ok at first sight, and it works ok when visual editing is
disabled. But in WYSIWYG mode, there are problems: In the second editor,
the iconbar is missing until "visual" is clicked. Then, the editor
instances seem to interfer, both seem to be damaged (especially
switching from visual to HTML mode), although basic WYSIWYG operations
work.

I wonder: are these bugs, have I done something wrong, or is it simply
impossible to have two editor instances on one page?

Tested with r7402 in FF 2.0.0.12/Linux.


Regards,
Alex

-- 
Alex Günsche, Zirona OpenSource-Consulting
Blogs: http://www.zirona.com/ | http://www.regularimpressions.net
*** Want to test the shiny new release of InstantUpgrade? ***
http://www.zirona.com/blog/software/instantupgrade-10-beta/



More information about the wp-hackers mailing list