WordPress.org

Make WordPress Core

Opened 22 months ago

Closed 21 months ago

Last modified 20 months ago

#21807 closed task (blessed) (fixed)

Caption editing in the media modal library view

Reported by: koopersmith Owned by: koopersmith
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords:
Focuses: Cc:

Description

When inserting an attachment into a post or creating a gallery, the user should be able to easily change the caption of any attachment via a text box immediately below the attachment's thumbnail. This caption will then be synced to the database as soon as the text field is deselected.

Currently, the attachment template in the media modal library view contains a div with the "describe" class, but nothing more. What we need now is…

  • An option in the workflow controller to support inline caption editing.
  • The caption rendered in the attachment template.
  • The caption synced to the database on save.

Change History (10)

comment:1 follow-up: azaozz22 months ago

Editing a caption would also need to sync/reload the gallery preview in MCE (if there is a gallery).

comment:2 in reply to: ↑ 1 koopersmith22 months ago

Replying to azaozz:

Editing a caption would also need to sync/reload the gallery preview in MCE (if there is a gallery).

For galleries, yes. This should happen automatically with #21815.

For attachments, I'm not so sure; it's actually one of the pieces that's up for debate. I think the most recent resolution was that once an attachment is inserted into a post, it is no longer synced with the database.

comment:3 azaozz22 months ago

Right, image attachments that are inserted in a post stop being "attachments" and become part of the post. The size, alignment, caption can be edited as part of the post.

Last edited 22 months ago by azaozz (previous) (diff)

comment:4 koopersmith22 months ago

In [22045]:

Media JS: Give the master Workspace view control over which Attachment view it uses. see #21390, #21807, #21809.

comment:20 koopersmith21 months ago

  • Owner set to koopersmith
  • Resolution set to fixed
  • Status changed from new to closed

In [22173]:

Caption editing in the media modal library.

  • Adds a describe option to the workflow controller to support inline caption editing.
  • For images, descriptions are mapped to the caption attribute.
  • For other media items, descriptions are mapped to the title attribute.
  • Descriptions are saved when the textarea's change event fires (i.e. when the textarea is blurred).

fixes #21807, see #21390.

comment:21 koopersmith21 months ago

In [22174]:

Add caption and title default values for the attachment view template. see #21390, #21807.

comment:22 koopersmith21 months ago

In [22178]:

Media Modal: Reduce height on the attachment captions from three lines to two. see #21390, #21807.

comment:23 koopersmith21 months ago

In [22200]:

Media Modal: Check for empty keys when saving attachment captions. see #21390, #21807.

comment:24 koopersmith21 months ago

In [22212]:

Add a nonce to wp_ajax_save_attachment. see #21390, #21807.

comment:25 blepoxp20 months ago

Hi,
I see that description gets mapped to different fields depending on the type of attachment. Will we be adding the ability to specifically modify individual fields from here in the future (like the image title and alt tag fields) or will that be restricted to the main Media Library interface? If so, is there a better ticket to ask this question or track progress for that?

Thanks

Note: See TracTickets for help on using tickets.