Skip Navigation

[Resolved] Checkbox Comma Separated Values to Array conversion issue 2

This support ticket is created 4 years, 6 months 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9: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: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by manishB-2 4 years, 6 months ago.

Assisted by: Jamal.

Author
Posts
#1654885

So i asked for help from Plugin developer and provided a code sample which was used for Gravity form's checkboxes values to convert as serialized array, So he wrote down a code but that's not working and I may need your help to make it work. I am really in trouble if it doesn't work. So Please assist me somehow. Below is the code given by the plugin developer.

function f4d_convert_metadata( $attr ) {
    // CHANGE THIS LIST TO ANY META DATA YOU NEED TO CONVERT
    $meta_keys = array( 'form_meta_key1', 'form_meta_key2', 'form_meta_key3' );
    // DO NOT CHANGE BELOW CODE
    $post_id = $attr['post_id'];
    foreach($meta_keys as $meta_key){
        // Grab meta value
        $meta_value = get_post_meta( $post_id, $meta_key, true );
        // Convert to Array
        $meta_value = explode(',', $meta_value);
        // Save it as array
        update_post_meta( $post_id, $meta_key, $meta_value );
    }
}
add_action('super_front_end_posting_after_insert_post_action', 'f4d_convert_metadata', 10, 1);

So my old support ticket is already there but That ticket is closed. and I had replied back to that ticket and shared my site access in private message. So please visit https://toolset.com/forums/topic/my-third-party-form-is-not-storing-values-in-wp-types-checkboxes-field/#post-1652847 (1)
https://toolset.com/forums/topic/checkbox-comma-separated-values-to-array-conversion-issue/ (2)
to get my login credentials. and you can also find complete details of my request in this old ticket no. (1).

Waiting to hear from you.

#1655677

Hello! As we have an already created ticket where we are working on this issue, I'll have to kindly ask you to mark this ticket as resolved.
I have already replied to the previous ticket asking for a copy of your website for debugging locally as I got stuck when working on your staging site.

#1656489

My issue is resolved now. Thank you!