How to show custom field’s value under post/page title in wp-admin

I’m trying to add the value of a custom field under the post/page title in wp-admin list of posts/pages (much like excerpt mode in posts list) without hooking into the columns process since other plugins are already doing that and it looks like each cancels the other.

Here’s a screenshot of what I’m trying to achieve:

Read More

screenshot of pages list

Thanks!

Related posts

Leave a Reply

2 comments

  1. Just like you add new columns you render the title filed your self

    add_action( 'manage_posts_custom_column', 'admin_post_data_row', 10, 2);
    function admin_post_data_row($column_name, $post_id)
    {
        switch($column_name){
            case 'title':       
                edit_post_link(get_post_title($post_id), '<p>', '</p>',$post_id);
                echo '<br />'.get_post_meta($post_id,'field_name',true);
                break;
            default:
                break;
        }
    }
    

    and if you have another plugin cancels this then simply set the filter hook priority to something bigger.

  2. You can hook into the post_row_actions as follows:

    add_filter('post_row_actions', 'wpse_43281_post_row_actions', 10, 2);
    function wpse_43281_post_row_actions($actions, $post){
        $meta_value = get_post_meta($post->ID, 'key', true);
        $actions[] = "Meta Value: $meta_value"; //This will add to the hidden hover list
        echo $meta_value; //This will display below the post title 
        return $actions; //Important!
    }