Skip to content

Add media picker field type for plugin settings schema #174

@jdevalk

Description

@jdevalk

Problem

Plugin settingsSchema currently supports string, number, boolean, select, and secret field types. There's no way to let users select an image from the media library for a plugin setting.

This forces plugins to use a plain string URL field for settings like "Person image" or "Organization logo", which is a poor UX — users have to manually copy/paste media URLs instead of using the existing media picker.

Suggested solution

Add a media (or image) field type to SettingFieldType that renders the existing media picker component in the admin UI:

export interface MediaSettingField extends BaseSettingField {
  type: "media";
  /** Restrict to specific media types */
  accept?: "image" | "video" | "any";
}

The stored value would be the media storage key (or full URL), and the admin UI would render a thumbnail preview with a "Select" button that opens the media library modal.

Use case

The SEO plugin needs a Person image and Organization logo for schema.org markup. Currently using plain URL string fields as a workaround.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions