Opened 6 months ago
Last modified 2 months ago
#63728 accepted enhancement
In WP Admin -> Posts add 'Filter by author' dropdown and add visible labels for filters
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-screenshots has-patch changes-requested |
| Focuses: | accessibility, administration | Cc: |
Description
In the posts view, I think it would be an enhancement to have an ad additional 'filter by author' dropdown.
Also a visible label should be there on top of the dropdown as well as for the categories dropdown. So you can recognize better what filter the dropdown represents.
If the additional dropdown won't find any friends, still a visible label should be there for the categories.
Attachments (3)
Change History (14)
#4
@
6 months ago
I'm sorry I messed up a bit. Please if you want to try the patch also add the following line
wp_dropdown_authors_filter( $this->screen->post_type, $which );
after
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
in class-wp-posts-list-table.php
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
6 months ago
#6
@
6 months ago
- Keywords changes-requested added
I like the idea of making the labels visible. A couple things:
1) It looks strange to have two of the four select inputs have labels. We should probably either add all of them or none of them.
2) Should probably add a check to only display the author filter if there are multiple authors. For single-user sites, this would never be useful.
3) The query should also only fetch authors who have authored posts; this would help streamline the results. There's no need to have a filter that represents users who don't have posts. What you actually need is to fetch all users who have published posts in the designated post type; you can use the has_published_posts argument to get that data.
As a side note that could be looked at when this is fleshed out into a more complete patch - there is an alignment issue on the bottom of the buttons/select inputs. If it's simple to resolve, it might make sense to take care of it with this issue.
#7
@
6 months ago
I also think that adding a group to wrap the filters with a group name of 'Filters' would allow us to make the labels less repetitive, by removing the text "Filter by". The function of the group is visibly set by the button text, and having a group (fieldset or role="group") would allow us to note the function of the group of inputs.
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
4 months ago
#10
@
2 months ago
- Milestone changed from Awaiting Review to 7.0
- Owner set to joedolson
- Status changed from new to accepted
I'm attaching a proof-of-concept patch