You can use the ctdb_registration_form_fields filter to add fields to your registration form. Below is an example of how this is done.
In your functions.php file, or other suitable place, add the following:
function rf_ctdb_registration_form_fields( $form ) {
$form['ctdb_user_test'] = array(
'id' => 'ctdb_user_test',
'label' => __( 'Test', 'wp-discussion-board' ),
'field' => 'input',
'type' => 'text',
'class' => 'required',
'meta_key' => 'test_meta_key'
);
return $form;
}
add_filter( 'ctdb_registration_form_fields', 'rf_ctdb_registration_form_fields' );
You should:
- Ensure the element key and id match.
- Change the
labelto your field label fieldshould be ‘input’typeshould be ‘text’classshould be ‘required’ if the field is requiredmeta_keyis the name of the meta key where you’d like to field value to be saved
