• Resolved The Three

    (@3wwwgr)


    Hello!

    1) i have created a new custom post type
    2) in that custom post type i have added some custom new columns with values from post meta
    3) in that custom post type i use only ‘author’ and ‘post meta’, so i dont need the ‘title’ columns and i have remove that column with
    unset( $columns['title'] ) at manage_{post_type}_posts_columns filter

    but when i remove that column the date and time fields in quick edit fieldset is missing

    any way around?
    thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Do you mean manage_{post_type}_posts_custom_columns filter? How are you getting to quick edit? When I remove the title column on my site the action link to quick edit goes away as well. I cannot look closer since I can’t get to quick edit.

    Looking at the quick edit source code, I don’t see how the title column relates to quick edit date/time fields at all. It seems something else is going on besides removing a column.

    Thread Starter The Three

    (@3wwwgr)

    Hello @bcworkz ,

    With manage_{$post->post_type}_posts_custom_column you can change the value of cells. Before that, you must set what column to display with manage_{post_type}_posts_columns

    now, if i leave the “title” column the date works fine… if i remove it, the date breaks

    https://pasteboard.co/IVwTjG7.png

    Thread Starter The Three

    (@3wwwgr)

    I found a work around… insist removing the title column and add a custom one
    i filtered the original title column like this

    function filter_post_title($title, $post_id){
        global $current_screen;
        if ($current_screen->id == 'edit-custom_post_type'){
            return get_post_meta( 'Custom title', 'name', true );
        }
    }
    add_filter('the_title', 'filter_post_title', 100, 2);
    Moderator bcworkz

    (@bcworkz)

    Hah! Clever ?? Good “out of the box” thinking.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Quick edit & Custom Columns’ is closed to new replies.