Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#38085 closed defect (bug) (fixed)

Add a 'View' link to users listed on the Users screen

Reported by: johnbillion's profile johnbillion Owned by: ryanplas's profile ryanplas
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Users Keywords: good-first-bug has-patch
Focuses: administration Cc:

Description

On the listing screens for posts, pages, categories, tags, media, etc, there's a 'View' link for each item. Not so for the Users screen.

The 'View' link should point to the user's author archive using get_author_posts_url().

Related: #20307

Attachments (5)

38085.patch (951 bytes) - added by ryanplas 7 years ago.
38085.2.patch (1020 bytes) - added by johnjamesjacoby 7 years ago.
Whitespace, and skip if get_author_posts_url() returns an empty result (thanks to a mutable filter at the end)
38085.3.patch (1.2 KB) - added by viralsampat 6 years ago.
Fixed
38085.4.patch (1.1 KB) - added by Girishpanchal 6 years ago.
38085.5.diff (1.3 KB) - added by xkon 6 years ago.
Updated last patch with sprintf & aria-label

Download all attachments as: .zip

Change History (20)

#1 @johnbillion
7 years ago

  • Keywords good-first-bug added

#2 @kkoppenhaver
7 years ago

Checking in from contributor day, happy to take a look at this one.

#3 @kkoppenhaver
7 years ago

Talking it over at said contributor day and there's already work in progress on this one.

#4 @antpb
7 years ago

  • Owner set to ryanplasma
  • Status changed from new to assigned

#5 @antpb
7 years ago

  • Owner changed from ryanplasma to ryanplas

Helping ryanplas assigning to avoid conflict

Last edited 7 years ago by antpb (previous) (diff)

@ryanplas
7 years ago

#6 @ryanplas
7 years ago

  • Keywords has-patch added; needs-patch removed

@johnjamesjacoby
7 years ago

Whitespace, and skip if get_author_posts_url() returns an empty result (thanks to a mutable filter at the end)

@viralsampat
6 years ago

Fixed

#7 @Girishpanchal
6 years ago

I have made changes on existing .path to improve coding standard.
Solve phpcs notice:

  1. Expected 1 space before/after closing bracket [ ( 'View' ) ]
  2. Line indented incorrectly

Also, Updated user view URL, I thought that we don't need to add add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) while creating URL. So, I have removed it.

Thank you

This ticket was mentioned in Slack in #core by viralsampat. View the logs.


6 years ago

#9 @swissspidy
6 years ago

@Girishpanchal Thanks for your patch!

In other list tables, an aria-label attribute is used for this link. See https://github.com/WordPress/wordpress-develop/blob/bb6e34a7fd236f1b88bc2ccf3b0d91a557368e45/src/wp-admin/includes/class-wp-terms-list-table.php#L462-L467 for an example.

Here we should add such an attribute as well for improved accessibility. You should also use sprintf() to make the code more readable.

@xkon
6 years ago

Updated last patch with sprintf & aria-label

#10 @xkon
6 years ago

Patch: 38085.5.diff
Updated: @Girishpanchal patch with sprintf & made use of an aria label as of 'View user %s' per @swissspidy suggestion.

Best regards,
Konstantinos

This ticket was mentioned in Slack in #core-themes by xkon. View the logs.


6 years ago

#12 @SergeyBiryukov
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 41027:

Users: Add a "View" link to users listed on the Users screen that points to the user's author archive.

Props ryanplas, johnjamesjacoby, viralsampat, Girishpanchal, xkon.
Fixes #38085.

This ticket was mentioned in Slack in #core by desrosj. View the logs.


6 years ago

#14 @netweb
6 years ago

  • Milestone changed from Awaiting Review to 4.9

#15 @SergeyBiryukov
6 years ago

In 41180:

Users: After [41027], assign $author_posts_url outside of the condition to simplify the logic.

See #38085.

Note: See TracTickets for help on using tickets.