From c12f643bdcc956be782de160f1c2148f24df7a60 Mon Sep 17 00:00:00 2001 From: Khokan Sardar Date: Sat, 25 Jul 2026 08:44:49 +0530 Subject: [PATCH 1/3] Twenty Twenty-One: Skip the untitled title filter in the admin. The theme filters `the_title` to display 'Untitled' for posts and pages that are missing a title. Since #65022, the post list table shows a trimmed excerpt in place of a missing title, but this filter fills the title with 'Untitled' and prevents that excerpt fallback from appearing in the admin. Only apply the filter on the front end, leaving admin titles untouched. Fixes #65710. See #65022. --- .../themes/twentytwentyone/inc/template-functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-content/themes/twentytwentyone/inc/template-functions.php b/src/wp-content/themes/twentytwentyone/inc/template-functions.php index 529564c295319..57281b128a981 100644 --- a/src/wp-content/themes/twentytwentyone/inc/template-functions.php +++ b/src/wp-content/themes/twentytwentyone/inc/template-functions.php @@ -182,11 +182,16 @@ function twenty_twenty_one_continue_reading_link() { * Adds a title to posts and pages that are missing titles. * * @since Twenty Twenty-One 1.0 + * @since Twenty Twenty-One 2.9 Only applies the filter on the front end. * * @param string $title The title. * @return string */ function twenty_twenty_one_post_title( $title ) { + if ( is_admin() ) { + return $title; + } + return '' === $title ? esc_html_x( 'Untitled', 'Added to posts and pages that are missing titles', 'twentytwentyone' ) : $title; } } From b621a1d96194a84255014a784d62718d60c775f4 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Tue, 28 Jul 2026 15:44:05 -0500 Subject: [PATCH 2/3] Update dashboard test to match admin title --- tests/e2e/specs/dashboard.test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/e2e/specs/dashboard.test.js b/tests/e2e/specs/dashboard.test.js index 9d290e58a9d50..0481d306f2e0b 100644 --- a/tests/e2e/specs/dashboard.test.js +++ b/tests/e2e/specs/dashboard.test.js @@ -149,11 +149,9 @@ test.describe( 'Quick Draft', () => { await saveDraftButton.click(); // Check that the new draft title appears in the 'Your Recent Drafts' section. - // This test relies on Twenty Twenty-One being the active theme. - // Twenty Twenty-One alters the default post title from "(no title)" to "Untitled". await expect( page.locator( '.drafts .draft-title' ).first().getByRole( 'link' ) - ).toHaveText( 'Untitled' ); + ).toHaveText( '(no title)' ); await expect( page.locator( '.drafts .draft-content' ).first() @@ -164,6 +162,6 @@ test.describe( 'Quick Draft', () => { await expect( page.locator( '.type-post.status-draft .title' ).first() - ).toContainText( 'Untitled' ); + ).toContainText( '(no title)' ); } ); } ); From 71a41d3da70b8876af0e29722c4a0d6c7ef7b734 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Tue, 28 Jul 2026 16:05:06 -0500 Subject: [PATCH 3/3] Update translator context. --- .../themes/twentytwentyone/inc/template-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-content/themes/twentytwentyone/inc/template-functions.php b/src/wp-content/themes/twentytwentyone/inc/template-functions.php index 57281b128a981..f141b99a8cf8f 100644 --- a/src/wp-content/themes/twentytwentyone/inc/template-functions.php +++ b/src/wp-content/themes/twentytwentyone/inc/template-functions.php @@ -192,7 +192,7 @@ function twenty_twenty_one_post_title( $title ) { return $title; } - return '' === $title ? esc_html_x( 'Untitled', 'Added to posts and pages that are missing titles', 'twentytwentyone' ) : $title; + return '' === $title ? esc_html_x( 'Untitled', 'Added on the front end to posts and pages that are missing titles', 'twentytwentyone' ) : $title; } } add_filter( 'the_title', 'twenty_twenty_one_post_title' );