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.
Built from https://develop.svn.wordpress.org/trunk@41027


git-svn-id: http://core.svn.wordpress.org/trunk@40877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-07-11 13:30:44 +00:00
parent a545745a54
commit 6724151d41
2 changed files with 12 additions and 1 deletions

View File

@ -425,6 +425,17 @@ class WP_Users_List_Table extends WP_List_Table {
if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) ) if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) )
$actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>"; $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>";
// Add a link to the user's author archive, if not empty.
if ( $author_posts_url = get_author_posts_url( $user_object->ID ) ) {
$actions['view'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
esc_url( $author_posts_url ),
/* translators: %s: author's display name */
esc_attr( sprintf( __( 'View posts by %s' ), $user_object->display_name ) ),
__( 'View' )
);
}
/** /**
* Filters the action links displayed under each user in the Users list table. * Filters the action links displayed under each user in the Users list table.
* *

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.9-alpha-41026'; $wp_version = '4.9-alpha-41027';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.