Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data views: Only display relevant options in status filter #55886

Closed
jameskoster opened this issue Nov 6, 2023 · 3 comments · Fixed by #55967
Closed

Data views: Only display relevant options in status filter #55886

jameskoster opened this issue Nov 6, 2023 · 3 comments · Fixed by #55967
Assignees
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Enhancement A suggestion for improvement. [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.

Comments

@jameskoster
Copy link
Contributor

jameskoster commented Nov 6, 2023

Related #55083

In the Pages management view all post statuses appear in the Status filter dropdown. This can lead to irrelevant filter configurations, for example if you install WooCommerce you'll find order statuses as options while managing pages:

Screenshot 2023-11-06 at 09 57 43

Some context from @oandregal:

but the issue here seems to be that statuses are unbound: they affect all post types – see, for example, register_post_status. I can see how Woo may be registering some new statuses that show up there in your setup.

The issue is that we don't know for which post type a status is registered, and we cannot simply remove the ones that are not the default from core: we'd also be removing post types that plugins intentionally added for pages, for example (editorial flow).

The way forward may be what Jorge already suggested: allow providing statuses that are bound to a Custom Post Type.

@jameskoster jameskoster added [Type] Bug An existing feature does not function as intended [Type] Enhancement A suggestion for improvement. [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Nov 6, 2023
@oandregal
Copy link
Member

@jameskoster would you be able to share a screenshot of your wp-admin page for pages? I don't see the trash status in the list you share, so I wonder whether you'd see the Trash link at the top-right of that page:

Captura de ecrã 2023-11-06, às 11 47 06

@oandregal oandregal added the [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked. label Nov 6, 2023
@jameskoster
Copy link
Contributor Author

jameskoster commented Nov 6, 2023

Yes I see Trash in the wp-admin Pages view:

Screenshot 2023-11-06 at 12 58 53

Edit: It does seem to be related to custom statuses though. If I disable WooCommerce then Trash appears as an option:

Screenshot 2023-11-06 at 13 01 34

@oandregal
Copy link
Member

oandregal commented Nov 8, 2023

I've discussed this issue with others, to better understand the way forward here. It seems sensible to only support the core statuses right now.

We want to support custom statuses as well. However, that has many ramifications, see #3144 and https://core.trac.wordpress.org/ticket/12706 Plugins would need to migrate to this new API. It's something that would take time, and it's beyond the current scope for the dataviews project at the moment. It needs to be looked at separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Enhancement A suggestion for improvement. [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants