WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 22 months ago

Last modified 21 months ago

#38085 closed defect (bug) (fixed)

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

Reported by: johnbillion Owned by: 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 3 years ago.
38085.2.patch (1020 bytes) - added by johnjamesjacoby 2 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 22 months ago.
Fixed
38085.4.patch (1.1 KB) - added by Girishpanchal 22 months ago.
38085.5.diff (1.3 KB) - added by xkon 22 months ago.
Updated last patch with sprintf & aria-label

Download all attachments as: .zip

Change History (20)

#1 @johnbillion
3 years ago

  • Keywords good-first-bug added

#2 @kkoppenhaver
3 years ago

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

#3 @kkoppenhaver
3 years ago

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

#4 @antpb
3 years ago

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

#5 @antpb
3 years ago

  • Owner changed from ryanplasma to ryanplas

Helping ryanplas assigning to avoid conflict

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

@ryanplas
3 years ago

#6 @ryanplas
3 years ago

  • Keywords has-patch added; needs-patch removed

@johnjamesjacoby
2 years ago

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

@viralsampat
22 months ago

Fixed

#7 @Girishpanchal
22 months 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.


22 months ago

#9 @swissspidy
22 months 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
22 months ago

Updated last patch with sprintf & aria-label

#10 @xkon
22 months 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.


22 months ago

#12 @SergeyBiryukov
22 months 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.


21 months ago

#14 @netweb
21 months ago

  • Milestone changed from Awaiting Review to 4.9

#15 @SergeyBiryukov
21 months 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.