Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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:

screenshot of pages list

Thanks!

share|improve this question
    
Would you settle for adding another column with this data? –  Brian Fegter Feb 23 '12 at 17:03
    
@BrianFegter thanks, but that's something I was able to do! –  Amit Feb 23 '12 at 17:36

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
thanks a lot, very helpful! toda! –  Amit Feb 24 '12 at 18:52
    
@Amit eyn al maa :) –  Bainternet Feb 24 '12 at 19:46

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!
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.