Skip to content

Add a generalised PostPicker component to allow selecting post(s) from a modal #71128

@andrewserong

Description

@andrewserong

Related to the idea of a new media library in Phase 3 of Gutenberg (#55238) but also useful in its own right:

What problem does this address?

Add a PostPicker component that can be used to display a modal for selecting one or many posts. It could use DataViews (or similar componentry) and also form the basis for a media library in a modal, too.

Potential uses

What is your proposed solution?

In terms of how it might look, I imagine it could look quite similar to the Pages screen in the site editor, but with a button at the bottom right to "Select" rather than an "Add Page" button at the top right. For patterns or media, it might default to the Grid layout instead, though.

Image

For a reference point in the core wp-admin areas, there's currently a simple modal available for the "attach to" behaviour of the media library. It looks like this:

Image

Related issues

Metadata

Metadata

Assignees

Labels

[Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Status] In ProgressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions