From 9b105d92a4b769f396ba798db1f106abab75001f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 11 Jul 2022 18:20:04 +0000 Subject: [PATCH] Editor: Include user's name in the `wp_refresh_post_lock()` response. This ensures that the post lock data returned by the Heartbeat API is consistent. Previously, `wp_check_locked_posts()` was updated to return the name of the user currently editing the post, but the `wp_refresh_post_lock()` response did not get a similar change. Follow-up to [53070]. Props nathan.noom. Merges [53692] to the 6.0 branch. Fixes #56197. git-svn-id: https://develop.svn.wordpress.org/branches/6.0@53693 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/misc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php index 20aad2464a..7e1ca3f7ad 100644 --- a/src/wp-admin/includes/misc.php +++ b/src/wp-admin/includes/misc.php @@ -1190,6 +1190,7 @@ function wp_refresh_post_lock( $response, $data, $screen_id ) { if ( $user ) { $error = array( + 'name' => $user->display_name, /* translators: %s: User's display name. */ 'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name ), );