[wp-trac] [WordPress Trac] #18311: Support HTML in image captions.

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 26 23:13:11 UTC 2012


#18311: Support HTML in image captions.
-----------------------------------+-----------------------
 Reporter:  prettyboymp            |       Owner:  sushkov
     Type:  task (blessed)         |      Status:  assigned
 Priority:  normal                 |   Milestone:  3.4
Component:  Editor                 |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  ux-feedback has-patch  |
-----------------------------------+-----------------------

Comment (by azaozz):

 Replying to [comment:44 sushkov]:
 > ...tricky stuff because `ed.translate()` replaces existing document.body
 with a new one, and old elements bindings die.

 Yes, unfortunately that's the way TinyMCE translates the iframe body in
 its popups. The way around it is to bind events after the translation is
 done.

 Replying to [comment:46 nacin]:
 > Is it possible to use wp_editor() (HTML editor only)?

 Currently there are five places where captions can be edited and only two
 use roughly the same code:
 - Media->Library screen (single image properties),
 - "Media" tab in the uploader popup (single image properties),
 - "From URL" tab in the uploader popup,
 - "Edit Image" popup in TinyMCE,
 - Editing directly in the visual editor.

 We can use wp_editor() in the first three as they are generated from PHP.
 The "Edit Image" popup in TinyMCE is all JS based, so Quicktags must be
 loaded directly there.

 However the question here is mostly UX: by far the best place to edit
 captions is directly in the visual editor. It is WYSIWYG and the user has
 access to more tools (other inline tags, remove formatting, etc.).

 Was thinking we can add third button that pops up when clicking on an
 image in the visual editor. Currently when users want to add a caption
 while composing a post they must:

 1. Open the "Edit Image" popup,
 2. Add some text in the caption field,
 3. Click Update/close the popup,
 4. Edit the text they added in step 2 and add HTML elements to it.

 The new button would add (and remove?) the caption elements around the
 image directly without the need to open the "Edit Image" popup, i.e. the
 users would start directly at step 4.

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


More information about the wp-trac mailing list