Skip to content

Media Library: Add DataViews/Forms fields specific to media/attachments #72612

@andrewserong

Description

@andrewserong

Part of #55238

In order to create different DataViews or DataForms for viewing, picking, or editing media, create dedicated fields for media/attachment properties.

These could include:

  • alt_text
  • caption
  • description
  • filename
  • filesize
  • media_dimensions
  • mime_type
  • media_thumnbail (display an image if available, fallback to displaying text of the filename?)
  • attached_to
  • date (read only)
  • modified (read only)
  • author (read only)

Use cases

Some questions / considerations

  • Where should the fields live? As discussed in Try using DataViewsPicker in an updated media modal #71944 (comment) if a post field like featured_image uses a media modal, and the media modal uses these media fields, then they likely shouldn't live in the same place as post fields (due to the risk of circular dependencies)
  • Should there be a separate package specifically for these fields? I.e. media-fields or something like that, instead of the fields package?
  • Related: should post fields (like featured_image) be more generic, and should there be a generic media_upload field that other fields can extend / re-use?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions