Edit the admin pst type title column

To edit the Admin header of your new post type page you need to add the following code:

add_action(‘admin_head-edit.php‘,’edit_change_title_function’);

in your function you have to check if the post type is the one you need, and then apply a filter for the title

function edit_change_title_function(){
global$post;
if($post->post_type == 'posttype_name') {
add_filter('the_title','posttype_title_function',100,2);
}
}

So, you can override the title getting the value from db:

function posttype_title_function($title, $post_id) {
$new_title = get_post_meta($post_id,'slb_first_name',true) .' '.get_post_meta($post_id,'slb_last_name',true);
return $new_title;
}
0 Comments

Add Your Comment: