Displaying Post Title on Post Edit page?

I’m trying to include the post title in a custom post type edit screen. For example if the post is called Biography, I want the edit page title to be ‘Edit Biography’. I’m using the below code:

function my_post_register() {
 $mypagetitle = $post->post_title;
 $labels = array(
  'edit_item' => __('Edit '.$mypagetitle),

Why isn’t this displaying the post title?

Related posts

Leave a Reply

2 comments

  1. This will do it:

    function edit_screen_title() {
        global $post, $title, $action, $current_screen;
    
        if( isset( $current_screen->post_type ) && $current_screen->post_type == 'post' && $action == 'edit' )
            $title = 'Edit ' . $post->post_title;
    }
    
    add_action( 'admin_head', 'edit_screen_title' );