Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#10517 closed feature request (wontfix)

the_editor() should not generate constant IDs in the HTML

Reported by: mark-k's profile mark-k Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:


the_editor() generates code which have constant IDs and therefor produces unsatisfactory GUI interaction when used twice in one page.

My goal is to be able to have two editors in the post editing page. Right now it seems like the main functionality - editing text, is working, but the quicktags are shown when the page loads and are not being hidden when clicking the "visual" button.

Change History (6)

#1 @azaozz
15 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

As TinyMCE is already loaded there you only need to init another instance of it (best done with another init array). If you need the HTML tab too, you'll need to add new function for switching tabs similar to the one in wp-admin/js/editor.js. To let the user edit the HTML you can also include the "code" button that shows it in a popup.

#2 @mark-k
15 years ago

  • Cc mark-k added
  • Resolution wontfix deleted
  • Status changed from closed to reopened

This is not a bug report, it is an enhancement request.... I can code around the issue and use the tinymce API directly as you suggest, or I can mess with WP core. messing with the core will destroy my ability to upgrade automatically, and while messing with tinymce directly might be more future prof I prefer not to count on it.

In the end I would like to see the_editor becoming an full blown official API which can be used anywhere for how many times that its needed, something that can be used with a feeling that it is future prof.

If you think that this cause is not worthy, lets close it that way, not because there are ways around the limitations of the_editor.

#3 @dd32
15 years ago

  • Type changed from enhancement to feature request

#4 @Denis-de-Bernardy
15 years ago

In the source, I'm reading this:

function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2)

Doesn't it allow for the ID to be set to something different already?

#5 @azaozz
15 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

Don't see the need to support replicating exactly the same editor more than once on the same page. This can be done for the default settings but may be unpredictable when another plugin modifies something.

Best option is for each plugin to use separate init array when it needs another instance of the editor on the same page. This would also give a lot more configuration options to the plugin.

#6 @Denis-de-Bernardy
14 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.