[wp-trac] [WordPress Trac] #19320: wp_tiny_mce() cannot call wp_editor(), and other issues

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 22 09:06:48 UTC 2011


#19320: wp_tiny_mce() cannot call wp_editor(), and other issues
-----------------------------+------------------
 Reporter:  nacin            |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  highest omg bbq  |   Milestone:  3.3
Component:  Editor           |     Version:
 Severity:  blocker          |  Resolution:
 Keywords:                   |
-----------------------------+------------------

Comment (by azaozz):

 Yeah, it is an odd class. It was modeled after WP_Scripts and is roughly
 equivalent of enqueueing two scripts that have shared dependencies and
 reuse the same localization object.

 The truth is that once the JS and CSS is outputted there's no need of any
 more PHP output to create more instances of the editors, both TinyMCE and
 Quicktags. It even had an (very) early iteration where the HTML didn't
 have any IDs, the whole DOM branch was cloned with JS and the editors
 initialized for the second, third, etc. instances.

 We probably can go one step back and split WP_Editor in separate
 functions. The code would be more verbose but not too much. We still can
 keep all related functions in a separate file (as @nacin suggests above)
 and would need to do `include_once()` for that file if somebody calls an
 old (deprecated) function.

 The public API is just one wrapper function that currently includes the
 file and passes along the args. Don't see how that can box us in, we can
 change it at any time to do anything else we need.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19320#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list