Support » Plugin: Advanced Contact form 7 DB » Add CF7_ID to admin display

  • Resolved rampau

    (@rampau)


    Hi, Thanks for your plugin, it’s awesome!
    I’d like to know if there’s a way to display the cf7_id (that is stored in the database) into de admin display. And if it is possible to do the same with the excel export. I’ve checked the actions and filter and i couldn’t find a way to do it.
    Thank you so much for your help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Vsourz Digital

    (@vsourz1td)

    Hello @rampau,

    We hope that you are speaking about the CF7-ID and not the data inserted id of the records. Below is the explanation to store the CF-ID and show it in back office

    We have restricted some default fields value for contact form7, and those fields value not store in database, when any form submit at front end, but you don’t worry, we have provided “vsz_cf7_no_save_fields” filter,using this filter you can modify these fields related changes.

    You need to add below code in your function file for display “contact form 7 id” on listing screen at back office.

    add_filter('vsz_cf7_no_save_fields','vsz_cf7_no_save_fields_callback');
    function vsz_cf7_no_save_fields_callback($arr_no_save_fields){
       
        if(($key = array_search('_wpcf7', $arr_no_save_fields)) !== false) {
            unset($arr_no_save_fields[$key]);
        }
       
        return $arr_no_save_fields;
    }

    We hope after added these code in your function file, all your requirement will be fulfill.

    If still you have any queries then let us know.

    Regards,

    Hi @vsourz1td!

    Thanks for your fast reply!
    I’m afraid I was talking about the other ID, I’ve checked it again and I see I made a mistake writing down the name of the field (sorry!). I’d like to display the “data_id” field in wp_cf7_vdata_entry or the “id” in the wp_cf7_vdata (I think are the same id). So I can keep track of how many forms have been submitted. Could it be done?

    Thank you again!
    Regards

    Plugin Author Vsourz Digital

    (@vsourz1td)

    Hello @rampau,

    Thanks for the clarification.

    To display “data_id” in back office listing page, you will need to add following code into your function file.

    // To Add extra column
    add_action('vsz_cf7_admin_after_heading_field','vsz_cf7_admin_after_heading_field_callback',12,2);
    function vsz_cf7_admin_after_heading_field_callback(){
        ?><th></th><?php
    }
    
    // To Display column value
    add_action('vsz_cf7_admin_after_body_field','vsz_cf7_admin_after_body_field_callback', 22, 2);
    function vsz_cf7_admin_after_body_field_callback($form_id, $row_id){
        $row_id = (int)$row_id;
        ?><td><?php echo $row_id; ?></td><?php
    }

    We hope after added these code in your function file, all your requirement will be fulfilled.

    If still you have any queries then let us know. We will surely help you to overcome your issue.

    Regards,
    Vsourz

    Hi, how can i prepend this to the csv aswell?

    brijesh267

    (@brijesh267)

    Hello,

    I have the problem to default delimiter in Excel .when i import on CSV option it doesn’t work

    anyone provide me for Sample CSV for import inquires so i can check again

    Plugin Author Vsourz Digital

    (@vsourz1td)

    Hello @brijesh267,

    You can download the csv and check for the records that have been exported and in the same format you can re-import them.

    Regards,

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.