WordPress.org

Make WordPress Core

Ticket #52314: 52314-5.diff

File 52314-5.diff, 1.2 KB (added by sabernhardt, 2 months ago)

using edit_item

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

     
    2222 * @global string    $update_title
    2323 * @global int       $total_update_count
    2424 * @global string    $parent_file
     25 * @global string    $typenow
    2526 */
    2627global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow,
    27         $update_title, $total_update_count, $parent_file;
     28        $update_title, $total_update_count, $parent_file, $typenow;
    2829
    2930// Catch plugins that include admin-header.php before admin.php completes.
    3031if ( empty( $current_screen ) ) {
     
    5758        $admin_title = sprintf( __( 'Recovery Mode — %s' ), $admin_title );
    5859}
    5960
     61if ( 'post' === $current_screen->base && 'add' !== $current_screen->action ) {
     62        $post_title = get_the_title();
     63        if ( ! empty( $post_title ) ) {
     64                $obj = get_post_type_object( $typenow );
     65                /* translators: Editor admin screen title. 1: "Edit item" text for the post type, 2: Post title. */
     66                $admin_title = sprintf( __( '%1$s “%2$s”' ), $obj->labels->edit_item, $post_title );
     67        }
     68}
     69
    6070/**
    6171 * Filters the title tag content for an admin page.
    6272 *