WordPress.org

Make WordPress Core

Ticket #38085: 38085.5.diff

File 38085.5.diff, 1.3 KB (added by xkon, 3 years ago)

Updated last patch with sprintf & aria-label

  • wp-admin/includes/class-wp-users-list-table.php

     
    419419                        } else {
    420420                                $edit = "<strong>$user_object->user_login</strong><br />";
    421421                        }
    422 
     422            // Check get author post url is not empty and add the view user link on user listing page.
     423            if ( ! empty( get_author_posts_url( $user_object->ID ) ) && $author_posts_url = get_author_posts_url( $user_object->ID ) ) {
     424                $view_link = esc_url( $author_posts_url );
     425                $actions['view'] = sprintf( '<a href="%s" aria-label="%s">%s</a>', $view_link, esc_attr( sprintf( __( 'View user &#8220;%s&#8221;' ), $user_object->user_login ) ) , __( 'View' ));
     426            }
    423427                        if ( !is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) )
    424428                                $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . "</a>";
    425429                        if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) )