Tagged: 

This topic contains 5 replies, has 2 voices, and was last updated by  Steve 4 years, 4 months ago.

  • Author
    Posts
  • #3765

    Quang Anh
    Participant

    Hi, I am newbie for Piklist. I try to create a DEMO CPT in piklist and a form to insert the data. Everything go write, I create a new metabox to extent data of new CPT. But I can not show it’s data in Test column in All CPT. I try and search for information to solve that problem but do not get the details. Please help & find the detail in attachments.

    add_filter(‘piklist_post_types’, ‘restaurant_post_types’);
    function restaurant_post_types($post_types)
    {
    $post_types[‘restaurant’] = array(
    ‘labels’ => piklist(‘post_type_labels’, ‘Restaurant’)
    ,’title’ => __(‘Enter Restaurant Name’)
    ,’public’ => true
    ,’rewrite’ => array(
    ‘slug’ => ‘restaurant’
    )

    ,’edit_columns’ => array(
    ‘title’ => __(‘Restaurant Name’)
    ,’author’ => __(‘Contact Email’)
    ,’date’ => __(‘Reg. Date’)
    ,’test’ => __(‘Test’)
    )
    ,’supports’ => array(
    ‘author’
    ,’revisions’
    ,’partners’
    ,’test’
    )
    ,’hide_post_row_actions’ => array(
    ‘trash’
    ,’quick-edit’
    )
    ,’hide_meta_box’ => array(
    ‘slug’
    ,’author’
    ,’revisions’
    ,’comments’
    ,’commentstatus’
    )
    ,’menu_icon’ => plugins_url(‘piklist/parts/img/piklist-icon.png’)
    ,’page_icon’ => plugins_url(‘piklist/parts/img/piklist-page-icon-32.png’)
    ,’status’ => array(
    ‘draft’ => array(
    ‘label’ => ‘New Restaurant’
    )
    ,’estimate’ => array(
    ‘label’ => ‘Request for Greenmeal Partner’
    )
    ,’quoted’ => array(
    ‘label’ => ‘Quoted’
    )
    )
    );

    return $post_types;
    }

    <?php
    /*
    Title: Restaurant
    Description: My cool new metabox
    Post Type: restaurant
    Meta Box: true
    Collapse: false
    */

    // Let’s create a text box field
    piklist(‘field’, array(
    ‘type’ => ‘text’
    ,’scope’ => ‘post’
    ,’field’ => ‘post_title’
    ,’label’ => __(‘Restaurant’)
    ,’description’ => __(‘Enter Restaurant Name’)
    ,’attributes’ => array(
    ‘class’ => ‘text’
    )
    ,’position’ => ‘wrap’
    ));

    piklist(‘field’, array(
    ‘type’ => ‘editor’
    ,’scope’ => ‘post’
    ,’field’ => ‘post_content’
    ,’label’ => ‘Add Story’
    ,’description’ => ‘Stories of Impact’
    ,’options’ => array (
    ‘media_buttons’ => true
    ,’teeny’ => true
    ,’textarea_rows’ => 5
    ,’drag_drop_upload’ => true
    )
    ));

    piklist(‘field’, array(
    ‘type’ => ‘text’
    ,’scope’ => ‘post_meta’
    ,’field’ => ‘test’
    ,’label’ => __(‘test’)
    ,’description’ => __(‘Enter test test’)
    ,’attributes’ => array(
    ‘class’ => ‘text’
    )
    ,’position’ => ‘wrap’
    ));
    ?>

    Attachments:
    You must be logged in to view attached files.
  • #3770

    Steve
    Keymaster

    Welcome to the Piklist community!

    Custom fields still need to be added to list tables the old fashioned way. Here’s a good post on how to do it.

  • #3776

    Quang Anh
    Participant

    Thanks Steve for quick reply! Everythings okay now.

    • #3777

      Quang Anh
      Participant

      Going with Piklist for 3 days and I think it is a good solution to solve management application. Will have something to show.

      P/s: How can I change my avatar. Can not find it in update profile and when I check in to Badges nothing happened!

    • #3783

      Steve
      Keymaster
      This reply has been marked as private.
  • #3784

    Steve
    Keymaster

    Great. Closing ticket

The topic ‘[Custom Post Type] New column data doesn't display’ is closed to new replies.