Make WordPress Core

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: presskopp's profile Presskopp Owned by: joedolson's profile joedolson
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)

filter_by_author.png (4.6 KB) - added by Presskopp 6 months ago.
63728.diff (3.3 KB) - added by Presskopp 6 months ago.
63728.png (18.9 KB) - added by Presskopp 6 months ago.

Download all attachments as: .zip

Change History (14)

#1 @Presskopp
6 months ago

  • Keywords has-screenshots added

#2 @Presskopp
6 months ago

I'm attaching a proof-of-concept patch

@Presskopp
6 months ago

#3 @Presskopp
6 months ago

  • Keywords has-patch added

#4 @Presskopp
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

@Presskopp
6 months ago

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


6 months ago

#6 @joedolson
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 @joedolson
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

#9 @joedolson
2 months ago

#63971 was marked as a duplicate.

#10 @joedolson
2 months ago

  • Milestone changed from Awaiting Review to 7.0
  • Owner set to joedolson
  • Status changed from new to accepted

This ticket was mentioned in Slack in #accessibility by sabernhardt. View the logs.


2 months ago

Note: See TracTickets for help on using tickets.