• Resolved Amanda Regan

    (@regan008)


    Hi,

    I’m using your plugin to create a series of checkboxes on the user profile page but I’m having trouble getting these to display on my custom registration form. Is it possible to render the fields within the registration form, and if so, do you have any suggestions for how I might post that data to the database field?

    Thanks so much!
    Amanda

    https://wordpress.org/plugins/cmb2/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Can you provide all the relevant code you’re using for this at the moment? It’ll help get our eyes on it and possibly get a solution going.

    Thread Starter Amanda Regan

    (@regan008)

    Of course, here is the github repository. Thepersonalize-login.php file has most of the code for functions that generate and process the registration form. This page also (near the bottom) has all of the cmb2 user meta field code. The form itself is in templates/register_form.php.

    The field I’m having the most trouble with is the multi checkbox that begins on line 859 ofpersonalize-login.php.
    ` $cmb_user->add_field( array(
    ‘name’ => __( ‘Test Multi Checkbox’, ‘cmb2’ ),
    ‘desc’ => __( ‘field description (optional)’, ‘cmb2’ ),
    ‘id’ => $prefix . ‘2016_volunteers’,
    ‘type’ => ‘multicheck’,
    ‘options’ => array(
    ’26’ => __( ’26’, ‘cmb2’ ),
    ’27’ => __( ’27’, ‘cmb2’ ),
    ’28’ => __( ’28’, ‘cmb2’ ),
    ),
    `

    Thanks so much, I really appreciate the help!

    Plugin Author Justin Sternberg

    (@jtsternberg)

    Hey Amanda,
    What you’re trying to do is definitely out of the box of the baked-in functionality that comes with CMB2, though definitely possible. I think the best example for doing something like this would be this tutorial. Obviously, replace “Create a New Post” with “Create a new user”, but the concept is pretty similar.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add user profile field to a custom registration field?’ is closed to new replies.