I have a custom registration form that includes billing information. In this form, I am having a parent register their child. The billing information users first name and last name are populating the WP profile default first name and last name. I need the child's first name and last name to populate the WP profile default first name and last name fields.
I've been trying various approaches to this for a day and simply cannot get it to work.
Here is a code snippet form my full script:
function add_student_extra_meta( $insert_metas, $data, $action ) {
update_option('test_x_student_insert_metas',$insert_metas);
update_option('test_x_student_insert_data',$data);
update_option('test_x_student_insert_action',$action);
$insert_metas['student_first_name'] = $data['student_first_name'];
$insert_metas['student_last_name'] = $data['student_last_name'];
return $insert_metas;
}
function x_enroll_child($parent_id){
$name = get_user_meta( $parent_id, 'student_first_name', true );
$last_name = get_user_meta( $parent_id, 'student_last_name', true );
}
Any ideas how I can get the value of student_first_name and student_last_name to populate the WP default values?