From a841368a3e0ae6ca2ca0de55e17f9f25bd4df6c2 Mon Sep 17 00:00:00 2001 From: joedolson Date: Mon, 1 Nov 2021 22:32:58 +0000 Subject: [PATCH] Editor: Include post's title in editor `title` element. Include the current post title in the `title` element when editing a post. Improve accessibility by distinguishing between different edit screens in the browser tab list. Props skierpage, alexstine, audrasjb, sabernhardt. Fixes #52314. Built from https://develop.svn.wordpress.org/trunk@51969 git-svn-id: http://core.svn.wordpress.org/trunk@51558 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-header.php | 12 +++++++++++- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index 2f7ae3b8c5..767276b974 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -22,9 +22,10 @@ if ( ! defined( 'WP_ADMIN' ) ) { * @global string $update_title * @global int $total_update_count * @global string $parent_file + * @global string $typenow */ global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, - $update_title, $total_update_count, $parent_file; + $update_title, $total_update_count, $parent_file, $typenow; // Catch plugins that include admin-header.php before admin.php completes. if ( empty( $current_screen ) ) { @@ -57,6 +58,15 @@ if ( wp_is_recovery_mode() ) { $admin_title = sprintf( __( 'Recovery Mode — %s' ), $admin_title ); } +if ( 'post' === $current_screen->base && 'add' !== $current_screen->action ) { + $post_title = get_the_title(); + if ( ! empty( $post_title ) ) { + $obj = get_post_type_object( $typenow ); + /* translators: Editor admin screen title. 1: "Edit item" text for the post type, 2: Post title. */ + $admin_title = sprintf( __( '%1$s “%2$s”' ), $obj->labels->edit_item, $post_title ); + } +} + /** * Filters the title tag content for an admin page. * diff --git a/wp-includes/version.php b/wp-includes/version.php index ec9a63a412..6c945ef0ac 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51968'; +$wp_version = '5.9-alpha-51969'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.