• Resolved optizign13

    (@optizign13)


    Hello, plugin is great so far. Thank you for immediate responses!

    I have an additional question. I noticed that UMM Forms that contains checkboxes has a unfamiliar code when translated into database. For example, I have a form with multi-selection checkboxes. The items that are check on, meta_value shows the following in database:

    a:5:{i:0;s:5:”Setup”;i:1;s:6:”Design”;i:2;s:7:”Develop”;i:3;s:3:”SEO”;i:4;s:4:”Tech”;}

    When importing other information in the same meta_value box, such as: selection1, selection2, selection3…it does not translate back into the form.

    http://wordpress.org/plugins/user-meta-manager/

Viewing 1 replies (of 1 total)
  • Plugin Author Jason Lau

    (@jason-lau)

    Checkbox groups and multi-select menus are saved as arrays.

    You can use WordPress’ built-in methods for getting and updating UMM data. Refer to the following codex reference pages –
    get_user_meta
    update_user_meta

    // get_user_meta(user ID, meta key, singular?);
    $my_checkbox_group = get_user_meta($any_user_ID, 'my_checkbox_group', true);
    // returns array
    foreach($my_checkbox_group as $key => $value):
    // loop through the array and print
     echo $key . '=>' . $value . '<br />';
    // set a new value for an item
     $my_checkbox_group[$key] = 'New Value';
    endforeach;
    
    // update saved data
    update_user_meta($any_user_ID, 'my_checkbox_group', $my_checkbox_group);
Viewing 1 replies (of 1 total)
  • The topic ‘Checkbox Submissions’ is closed to new replies.