Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've got some custom fields that I would like a user to be able to edit in Quick Edit, I can manage the columns but I'm unable to edit them if Quick Edit is clicked current code with custom fields I'd like to be able to edit:

/* custom columns */
add_filter("manage_edit-programmes_columns", "edit_columns" );
add_action("manage_posts_custom_column", "custom_columns");

function edit_columns($columns)
{
    $columns = array(
        "cb" => "<input type ='checkbox' />",
        "title" => "Schedule id",
        "programme" => "Programme",
        "channel" => "Channel", 
        "onair" => "On Air", 
        "catchup" => "Catchup", 
        "popularity" => "Popularity", 
        "onair" => "On Air", 
        "date" => "Date"
    );
    return $columns;
}

function custom_columns( $column ) {

    global $post;

    switch ( $column )
    {
        case "programme":
            echo get_post_meta($post->ID, 'Programme Name', true);
            break;
        case "channel":
            echo get_the_term_list($post->ID, 'channelnames', '', ', ', '');
            break;
        case "onair":
            echo get_post_meta($post->ID, 'Date Time Start', true);
            break;
        case "catchup":
            echo get_post_meta($post->ID, 'linktovideocatchup', true);
            break;
        case "popularity":
            echo get_post_meta($post->ID, 'popularityfig', true);
            break;
    }
}

Help very much appreciated.

share|improve this question

2 Answers

up vote 1 down vote accepted

A couple things,

  1. Make sure in your save_post hook you're checking for DOING_AJAX which is used for saving in quick-edit.
  2. Check out my other question: Quick edit screen customization. The answer I received worked, but I haven't actually implemented it into my plugin quite yet as it's not a priority of mine yet.

Hope that helps you out. ;)

share|improve this answer
eek! head spin, can't see how I add that to my custom_post_type and access my custom fields? – erichmond Mar 1 '11 at 21:56
So I presume I need to change the form input Name and ID to match my custom field to make it work - right? – erichmond Mar 2 '11 at 6:06
I personally haven't done this as I've stated in my answer. I was merely passing along the answer I received that looked like it might work. It hasn't been a priority of mine with my current project because it seems whenever something I want to do, something else comes up and I have to go fix that and I forget about the original thing I wanted to do. :/ – Zack Mar 2 '11 at 6:14
Ok no worries, thanks for the pointer anyway :-) – erichmond Mar 2 '11 at 8:06

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.