|
49 | 49 | /* translators: Admin screen title. %s: Admin screen name. */ |
50 | 50 | $admin_title = sprintf( __( '%s — WordPress' ), $title ); |
51 | 51 | } else { |
| 52 | + $screen_title = $title; |
| 53 | + |
| 54 | + if ( 'post' === $current_screen->base && 'add' !== $current_screen->action ) { |
| 55 | + $post_title = get_the_title(); |
| 56 | + if ( ! empty( $post_title ) ) { |
| 57 | + $post_type_obj = get_post_type_object( $typenow ); |
| 58 | + $screen_title = sprintf( |
| 59 | + /* translators: Editor admin screen title. 1: "Edit item" text for the post type, 2: Post title. */ |
| 60 | + __( '%1$s “%2$s”' ), |
| 61 | + $post_type_obj->labels->edit_item, |
| 62 | + $post_title |
| 63 | + ); |
| 64 | + } |
| 65 | + } |
| 66 | + |
52 | 67 | /* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */ |
53 | | - $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title ); |
| 68 | + $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $screen_title, $admin_title ); |
54 | 69 | } |
55 | 70 |
|
56 | 71 | if ( wp_is_recovery_mode() ) { |
57 | 72 | /* translators: %s: Admin screen title. */ |
58 | 73 | $admin_title = sprintf( __( 'Recovery Mode — %s' ), $admin_title ); |
59 | 74 | } |
60 | 75 |
|
61 | | -if ( '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 | | - |
70 | 76 | /** |
71 | 77 | * Filters the title tag content for an admin page. |
72 | 78 | * |
|
0 commit comments