Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to add custom $usermeta to registration


deadlyhifi
Participant

@tomdebruin

Been messing around with adding custom usermeta data at signup and have come up with the following:

`function bp_custom_user_signup() { ?>

<?php
}

add_action(‘bp_before_registration_submit_buttons’, ‘bp_custom_user_signup’);

// Add field_name from sign-up to usermeta on registration
function bp_user_activate_field( $signup ) {

update_usermeta( $signup, ‘name_of_field_in_template’, apply_filters( ‘get_name_of_field_in_template_value’, $_POST ) );

return $signup;
}
add_filter( ‘user_register’, ‘bp_user_activate_field’ );
`
Note that this data is put into the database at the point of registration, not at user activation as the original example suggested – but I couldn’t get that to work.

Skip to toolbar