0

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?

  • I read over and over; I can't really understand. Do you mind rephrasing? – nyedidikeke Jun 5 '17 at 22:41
  • Your pretty late to the game, I resolved this myself a few days after my post here. The solution was to move the update_options into the second function. – Dennis Jun 7 '17 at 16:58
-1

The solution was to move the update_options into the second function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.