From 37c514cc62182342f0eb7aecc38bbac075eb00f8 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Fri, 29 Jul 2022 17:06:15 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@53796 git-svn-id: http://core.svn.wordpress.org/trunk@53355 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 14 +++++++------- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 2d2e007e02..d58b2fef58 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -2288,7 +2288,8 @@ function wp_list_comments( $args = array(), $comments = null ) { * } * @type string $comment_field The comment textarea field HTML. * @type string $must_log_in HTML element for a 'must be logged in to comment' message. - * @type string $logged_in_as HTML element for a 'logged in as [user]' message. + * @type string $logged_in_as The HTML for the 'logged in as [user]' message, the Edit profile link, + * and the Log out link. * @type string $comment_notes_before HTML element for a message displayed before the comment fields * if the user is not logged in. * Default 'Your email address will not be published.'. @@ -2457,12 +2458,10 @@ function comment_form( $args = array(), $post = null ) { 'logged_in_as' => sprintf( '

%s%s

', sprintf( - /* translators: 1: Edit user link, 2: Accessibility text, 3: User name, 4: Logout URL. */ - __( 'Logged in as %3$s. Log out?' ), - get_edit_user_link(), - /* translators: %s: User name. */ - esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ), + /* translators: 1: User name, 2: Edit user link, 3: Logout URL. */ + __( 'Logged in as %1$s. Edit your profile. Log out?' ), $user_identity, + get_edit_user_link(), /** This filter is documented in wp-includes/link-template.php */ wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) ), @@ -2578,7 +2577,8 @@ function comment_form( $args = array(), $post = null ) { * * @since 3.0.0 * - * @param string $args_logged_in The logged-in-as HTML-formatted message. + * @param string $args_logged_in The HTML for the 'logged in as [user]' message, + * the Edit profile link, and the Log out link. * @param array $commenter An array containing the comment author's * username, email, and URL. * @param string $user_identity If the commenter is a registered user, diff --git a/wp-includes/version.php b/wp-includes/version.php index efb291f221..266559d886 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53795'; +$wp_version = '6.1-alpha-53796'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.