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.
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!
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.