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?

2 Answers
2

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' );

Leave a Reply

Your email address will not be published. Required fields are marked *