Fix annoying meaningless page titles in the WordPress post editor. Very helpful if you have to edit multiple posts at once and dont want to lose track.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'admin_title', 'fix_admin_page_title' , 10, 2 ); | |
function fix_admin_page_title( $admin_title, $title ) { | |
global $post, $title, $action, $current_screen; | |
$return = $admin_title; | |
if( isset( $current_screen->post_type ) && $action == 'edit' ) { | |
//$return = $post->post_title . ' (' . $post->ID . ') - ' . get_bloginfo('name'); | |
$return = $post->post_title . ' (' . $post->ID . ') - ' . $admin_title; | |
} | |
return $return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment