Skip to content

DataViews: visualize hierarchical data #74072

@oandregal

Description

@oandregal

Follow-up to #55957 and #66479

What

We want to display hierarchical data in WordPress 7.0.

This is the current state: it works with the Gutenberg plugin active. It's supported by the table layout, and it mimics wp-admin states: initial load, pagination, search, and filter maintain hierarchical order; sorting does not.

Screen.Recording.2025-12-17.at.15.54.20.mov

How

  • Update REST API to support these interactions. Core PR at Add logic to sort posts by hierarchy wordpress-develop#8014 We may also reconsider rethinking the approach so that the REST API endpoint can "return the children of X" — it could be useful in other scenarios such as command palette.
  • The level is not clear: add spaces between the dashes, like wp-admin does. DataViews: display a separate for each level #74199
  • Once you sort by a column, to come back to the hierarchical sorting, you need to reset the whole view (see video). We need to fix this so it's easier. Potential direction: add a "sorting by: hierarchical" config.
  • When in a page > 1, consider displaying the parent if the first item is a child page.
wp-admin site editor > pages
Image Image

After these all are done, we may also want to explore collapse/expand behavior in the table (example1, example2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions