Make WordPress Core


Ignore:
Timestamp:
07/29/2022 05:04:25 PM (2 years ago)
Author:
audrasjb
Message:

Comments: Improve accessibility of the "Logged in as" link in comment form.

This changeset ensures the "Logged in as" link conveys the information about its purpose ("Edit your profile") while the information "Logged in as Jane Doe" is only a simple text.

Props juliemoynat, SergeyBiryukov, joedolson, audrasjb, lopo.
Fixes #55718.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r53723 r53796  
    22892289 *     @type string $comment_field        The comment textarea field HTML.
    22902290 *     @type string $must_log_in          HTML element for a 'must be logged in to comment' message.
    2291  *     @type string $logged_in_as         HTML element for a 'logged in as [user]' message.
     2291 *     @type string $logged_in_as         The HTML for the 'logged in as [user]' message, the Edit profile link,
     2292 *                                        and the Log out link.
    22922293 *     @type string $comment_notes_before HTML element for a message displayed before the comment fields
    22932294 *                                        if the user is not logged in.
     
    24582459            '<p class="logged-in-as">%s%s</p>',
    24592460            sprintf(
    2460                 /* translators: 1: Edit user link, 2: Accessibility text, 3: User name, 4: Logout URL. */
    2461                 __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
     2461                /* translators: 1: User name, 2: Edit user link, 3: Logout URL. */
     2462                __( 'Logged in as %1$s. <a href="%2$s">Edit your profile</a>. <a href="%3$s">Log out?</a>' ),
     2463                $user_identity,
    24622464                get_edit_user_link(),
    2463                 /* translators: %s: User name. */
    2464                 esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
    2465                 $user_identity,
    24662465                /** This filter is documented in wp-includes/link-template.php */
    24672466                wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
     
    25792578                 * @since 3.0.0
    25802579                 *
    2581                  * @param string $args_logged_in The logged-in-as HTML-formatted message.
     2580                 * @param string $args_logged_in The HTML for the 'logged in as [user]' message,
     2581                 *                               the Edit profile link, and the Log out link.
    25822582                 * @param array  $commenter      An array containing the comment author's
    25832583                 *                               username, email, and URL.
Note: See TracChangeset for help on using the changeset viewer.