I assume your post type candidate is using slug "candidate", and each user only have one post in it, you can try this to
1) "get post of type candidate where author = current user"
1) "get post of type candidate where author = current user"
global $current_user; $args = array( 'author' => $current_user->ID, 'post_type'=> 'candidate'); $myposts = query_posts($args); if ( have_posts() ) { while ( have_posts() ) : $candidate_id = get_the_ID();; endwhile; } echo $candidate_id; // the post ID of post type candidate where author = current user
http://codex.wordpress.org/Function_Reference/query_posts
2) assign this post as parent of the job-application post created by this form
I assume your post type job-application is using slug "job-application", you can try like this:
add_post_meta($post_id, '_wpcf_belongs_job-application_id', $candidate_id, true);