Okay, I found rand in php, how do I get it into the registration process so it’s not random after it’s chosen for each member?
Okay, well, thanks anyway!
Search BuddyPress register hook, you can add code to the registration process. Possibly add a hidden sign up field that generates your number
This code is not tested but it’s an example of adding a field and then getting results.
`function bp_numb_add_reg_field() {
$rand_numb = //php to generate number here ;
echo ”;
}
add_action( ‘bp_before_registration_submit_buttons’, ‘bp_numb_add_reg_field’ );
function bp_numb_get_reg_data() {
if ( isset( $_POST ) ) {
$numb_value = $_GET;
// do something with the custom data
}
}
add_action( ‘bp_complete_signup’, ‘bp_numb_get_reg_data’ );`
Thanks! I will work with that.
I think I can use rand(1, 1000000);
but I don’t know what to do with it after that. I created a custom-fields area in my members-header.php file, where I echo out fields with variables, but I don’t know how to get this function from functions.php to members-header.php.