Skip Navigation

[Closed] get a list of multiple checked boxes to print in readable format from database

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 4 years ago.

Assisted by: Minesh.

Author
Posts
#2084043

I'm trying to export to a cvs file using wp import export and I need to get a list of multiple checked boxes to print in readable format.

This is the code I'm using, but it's printing blank. Any help would be so appreciated!

function get_cat_list($cat) {
$cat = unserialize( $cat);
$cat_array = [$cat['wpcf-fields-checkboxes-option-4b730924dd84d7ec838aa1b86f8236cc-1'] => 'Other',
$cat['wpcf-fields-checkboxes-option-3d05665749bfd56223244a32dd3c3454-1'] => 'Info, Referral & Assistance',
$cat['wpcf-fields-checkboxes-option-f75658f18eeb72118000caf9293d0946-1'] => 'Immigration',
$cat['wpcf-fields-checkboxes-option-791f3589299cdbc09dd917cf557954fc-1'] => 'Legal',
$cat['wpcf-fields-checkboxes-option-26c31625586c63bd246b8257c1e8fa78-1'] => 'Liaison',
$cat['wpcf-fields-checkboxes-option-68c9e405778872efec45051dc804e5b3-1'] => 'Paperwork',
$cat['wpcf-fields-checkboxes-option-5973102951dea4cef7fc835427de7767-1'] => 'Work Related'];
foreach($cat_array as $key => $value)
if(empty($value))
unset($cat_array[$key]);
return;
foreach($cat_array as $key => $value)
return($cat_array[$key] . ', ');
}

#2084393

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I need to check what content you imported and what is the value stored inside and how you are calling the function.

Please mention where you added the function you shared as well as problem URL where you are calling it.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

#2085055
Screen Shot 2021-06-11 at 3.22.06 PM.png
Screen Shot 2021-06-11 at 3.21.41 PM.png

I haven't Imported any data, I'm trying to Export CRED form submissions to a CVS file. I added the code above to the Child Theme Functions.php. I then added the function to the Export Field Editor(as shown in pic). When I preview, the column fields aren't unserialized. I'm not sure what I'm doing wrong.

#2088311

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I will require to test and see on your install whats going wrong with your setup.

Can you please share problem URL where you are trying to export the Toolset Forms data as well as admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

The topic ‘[Closed] get a list of multiple checked boxes to print in readable format from database’ is closed to new replies.