WordPress.org

Make WordPress Core

Ticket #52314: 52314-4.diff

File 52314-4.diff, 666 bytes (added by sabernhardt, 6 months ago)

'alternate' patch iteration, now checking for empty post title

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

     
    5757        $admin_title = sprintf( __( 'Recovery Mode — %s' ), $admin_title );
    5858}
    5959
     60if ( 'post' === $current_screen->base && 'add' !== $current_screen->action ) {
     61        $post_title = get_the_title();
     62        if ( ! empty( $post_title ) ) {
     63                /* translators: Editor admin screen title. %s: Post title. */
     64                $admin_title = sprintf( __( 'Edit “%s”' ), $post_title );
     65        }
     66}
     67
    6068/**
    6169 * Filters the title tag content for an admin page.
    6270 *