WordPress.org

Make WordPress Core

Ticket #52314: 52314-2.diff

File 52314-2.diff, 783 bytes (added by alexstine, 7 months ago)

Fix for Untitled.

  • src/wp-admin/admin-header.php

    diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php
    index d2b5fda09e..288d7d8684 100644
    a b if ( wp_is_recovery_mode() ) { 
    5757        $admin_title = sprintf( __( 'Recovery Mode — %s' ), $admin_title );
    5858}
    5959
     60if ( 'post' === $current_screen->base ) {
     61        $post_title = get_the_title();
     62        if ( 'Untitled' === $post_title ) {
     63                /* translators: Editor admin screen title. %s: Post type name. */
     64                $admin_title = sprintf( __( 'Add %s' ), ucwords( get_post_type() ) );
     65        } else {
     66                /* translators: Editor admin screen title. %s: Post title. */
     67                $admin_title = sprintf( __( 'Edit: "%s"' ), get_the_title() );
     68        }
     69}
     70
    6071/**
    6172 * Filters the title tag content for an admin page.
    6273 *