Adding and updating new fields on resume-submit page
-
Hi Mike,
I’ve just started to use your resume manager plugin these days. In my scenario, I’m gonna make the resume process as job apply process. Then, I need to do some customizations. Following your doc in github, I successfully added those new fields I wanted. However, everytime I submitted or updated these fields, they are actually not saved to the database.
To get the reason, I went to “class-wp-resume-manager-form-submit-resume.php” file, and found the code below:
/** * Submit Step */ public static function submit() { global $job_manager, $post; self::init_fields(); // Load data if neccessary if ( ! empty( $_POST['edit_resume'] ) && self::$resume_id ) { $resume = get_post( self::$resume_id ); foreach ( self::$fields as $group_key => $fields ) { foreach ( $fields as $key => $field ) { switch ( $key ) { case 'candidate_name' : self::$fields[ $group_key ][ $key ]['value'] = $resume->post_title; break; case 'resume_content' : self::$fields[ $group_key ][ $key ]['value'] = $resume->post_content; break; case 'resume_skills' : self::$fields[ $group_key ][ $key ]['value'] = implode( ', ', wp_get_object_terms( $resume->ID, 'resume_skill', array( 'fields' => 'names' ) ) ); break; case 'resume_category' : self::$fields[ $group_key ][ $key ]['value'] = current( wp_get_object_terms( $resume->ID, 'resume_category', array( 'fields' => 'slugs' ) ) ); break; default: self::$fields[ $group_key ][ $key ]['value'] = get_post_meta( $resume->ID, '_' . $key, true ); break; } } } self::$fields = apply_filters( 'submit_resume_form_fields_get_resume_data', self::$fields, $job ); } get_job_manager_template( 'resume-submit.php', array( 'class' => __CLASS__, 'form' => self::$form_name, 'resume_id' => self::get_resume_id(), 'action' => self::get_action(), 'resume_fields' => self::get_fields( 'resume_fields' ), 'submit_button_text' => __( 'Preview resume →', 'wp-job-manager-resumes' ) ), 'wp-job-manager-resumes', RESUME_MANAGER_PLUGIN_DIR . '/templates/' ); }
My question is how to save those fields using a filter. I need to save the job listing id or title in db so that the recruiter could check the candidate info as well as the job detail in their portal.
Thanks for your assistance again, Mike
- The topic ‘Adding and updating new fields on resume-submit page’ is closed to new replies.