Posted By : Date : fanuzzi | 04-03-2021
To edit the Admin header of your new post type page you need to add the following code: Hook add_action(‘admin_head-edit.php‘,’edit_change_title_function’); The edit 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; }
Read More
0 Comments