Plugin Author
Arshid
(@arshidkv12)
Change column order by following code.
add_filter('cfdb7_admin_subpage_columns', 'my_cfdb7_change_cols', 10, 2);
function my_cfdb7_change_cols( $columns, $form_id ){
if( $form_id == 1){ // change form id
$my_columns['your-name'] = 'Name'; //input filed name is array key
$my_columns['your-subhect'] = 'Subject';
$columns = $my_columns;
}
return $columns;
}
-
This reply was modified 1 year, 10 months ago by
Arshid.
Hello, where exactly should I put this code? I have tried it in several places and it doesn’t work for me. thank you so much.
Plugin Author
Arshid
(@arshidkv12)
Put code in theme functions.php
Thank you, it now works correctly. Thanks for your work again.
I also have this problem, but the code in functions is not solving it π
Gregy1403 – make sure you are using the Form Database ID (&fid) and not the Contact Form 7 ID for the form. You can find that in the URL when viewing the form in edit mode, or the form submissions for that form:
Form Edit: /wp-admin/admin.php?page=wpcf7&post=5966&action=edit
Submissions: /wp-admin/admin.php?page=cfdb7-list.php&fid=5966
As for the plugin author, having the normal WordPress ‘options’ panel at the top of the page with column headers to choose, or a custom chooser would be extremely helpful.
Right now, it just takes the first 4 columns it finds and a date, which in our case are redirection NONCE codes and other meaningless stuff.
If you want to have the check-box column when using above code, you can add the following code as the first column:
$my_columns['cb'] = '<input type="checkbox" />';
So it would look something like this:
add_filter('cfdb7_admin_subpage_columns', 'my_cfdb7_change_cols', 10, 2);
function my_cfdb7_change_cols( $columns, $form_id ){
if( $form_id == 1){ // change form id
$my_columns['cb'] = '<input type="checkbox" />';
$my_columns['your-name'] = 'Name'; //input filed name is array key
$my_columns['your-subhect'] = 'Subject';
$columns = $my_columns;
}
return $columns;
}