Title: Adding extra fields to WPJM
Last modified: August 31, 2017

---

# Adding extra fields to WPJM

 *  Resolved [kivo7](https://wordpress.org/support/users/kivo7/)
 * (@kivo7)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/adding-extra-fields-to-wpjm/)
 * Hi,
 * I am trying to show the new filed ‘job_experience’ which I have created via your
   tutorial. But it is not text value but array.
 *     ```
       add_filter( 'job_manager_job_listing_data_fields', 'admin_add_experience_field' );
       function admin_add_experience_field( $fields ) {
         $fields['_job_exprience'] = array(
           'label'       => __( 'Опыт', 'job_manager' ),
           'type'        => 'select',
           'required'    => false,
           'priority'    => 8,
           'options' => array(
                              'option[1]' => 'no experience',  // 'value'=>'label'
                              'option[2]' => '1 year',
                              'option[3]' => '2 year',
                              'option[4]' => '3 year' )
         );
         return $fields;
       }
       ```
   
 * To show on the job page I use this code:
 *     ```
       add_action( 'single_job_listing_meta_end', 'display_job_experience_data' );
       function display_job_experience_data() {
         global $post;
   
         $experience = get_post_meta( $post->ID, '_job_experience', true );
   
         if ( $experience ) {
           echo '<li>' . __( 'Experience: ' ) . esc_html( $experience ) . '</li>';
         }
       }
       ```
   
 * But it returns only key of array like ‘option[1]’, not a value ‘no experience’.
   What should I change in code to solve this problem?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Davor](https://wordpress.org/support/users/davoraltman/)
 * (@davoraltman)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/adding-extra-fields-to-wpjm/#post-9466362)
 * Hi there,
 * Please use the filter `submit_job_form_fields` to add a new field. For WP Admin
   area, please use `job_manager_job_listing_data_fields`. For details on this, 
   check out our tutorial here:
 * [https://wpjobmanager.com/document/editing-job-submission-fields/](https://wpjobmanager.com/document/editing-job-submission-fields/)
 * Also, I see that you missed an _e_ in `$fields['_job_exprience']` in the first
   snippet.
 * Let me know how it goes.
 * Thanks,
    Davor
 *  Thread Starter [kivo7](https://wordpress.org/support/users/kivo7/)
 * (@kivo7)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/adding-extra-fields-to-wpjm/#post-9466569)
 * Hi, Davor
 * Actually I read your tutorial several times and even made some fields with succes.
   But there were textarea fields, not selectboxes.
 * My full code is:
 *     ```
       //** Add field "job_experience" to the frontend
       add_filter( 'submit_job_form_fields', 'frontend_add_experience_field' );
       function frontend_add_experience_field( $fields ) {
         $fields['job']['job_experience'] = array(
           'label'       => __( 'Experience' ),
           'type'        => 'select',
           'required'    => false,
           'priority'    => 8,
           'options' => array(
                              'option1' => 'no experience',  // 'value'=>'label'
                              'option2' => '1 year',
                              'option3' => '2 years',
                              'option4' => '5 years' )
         );
   
         return $fields;
       }
   
       //** Add field "job_experience" to admin
       add_filter( 'job_manager_job_listing_data_fields', 'admin_add_experience_field' );
       function admin_add_experience_field( $fields ) {
         $fields['_job_experience'] = array(
           'label'       => __( 'Experience' ),
           'type'        => 'select',
           'required'    => false,
           'priority'    => 8,
           'options' => array(
                              'option1' => 'no experience',  // 'value'=>'label'
                              'option2' => '1 year',
                              'option3' => '2 years',
                              'option4' => '5 years' )
         );
         return $fields;
       }
   
       //** Display "job_experience" on the single job page
       add_action( 'single_job_listing_meta_end', 'display_job_experience_data' );
       function display_job_experience_data() {
         global $post;
   
         $experience = get_post_meta( $post->ID, '_job_experience', true );
   
         if ( $experience ) {
           echo '<li>' . __( 'Experience: ' ) . esc_html( $experience ) . '</li>';
         }
       }
       ```
   
 * Please let me know how to display the label of my filed on the single job page.
   Now I have only the value: [http://prntscr.com/ggx9a2](http://prntscr.com/ggx9a2).
   But I need to display not “option1”, but “no experience”.
 *  [Dat Hoang](https://wordpress.org/support/users/htdat/)
 * (@htdat)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/adding-extra-fields-to-wpjm/#post-9541161)
 * Hi there,
 * Thanks for your screenshots and the code.
 * That’s reasonable because you’re saving `option1` in your database. The following
   code is pulling that value only.
 * `$experience = get_post_meta( $post->ID, '_job_experience', true );`
 * To resolve this, you can do something like this.
 * Change the code
 *     ```
       //** Display "job_experience" on the single job page
       add_action( 'single_job_listing_meta_end', 'display_job_experience_data' );
       function display_job_experience_data() {
         global $post;
   
         $experience = get_post_meta( $post->ID, '_job_experience', true );
   
         if ( $experience ) {
           echo '<li>' . __( 'Experience: ' ) . esc_html( $experience ) . '</li>';
         }
       }
       ```
   
 * to
 *     ```
       //** Display "job_experience" on the single job page
       add_action( 'single_job_listing_meta_end', 'display_job_experience_data' );
       function display_job_experience_data() {
         global $post;
   
         $value_label =  array(
                              'option1' => 'no experience',  // 'value'=>'label'
                              'option2' => '1 year',
                              'option3' => '2 years',
                              'option4' => '5 years' )
         );
   
         $experience_value = get_post_meta( $post->ID, '_job_experience', true );
         $experience = $value_label[ 'experience_value' ]; // Get label
   
         if ( $experience ) {
           echo '<li>' . __( 'Experience: ' ) . esc_html( $experience ) . '</li>';
         }
       }
       ```
   
 * Please note that: this is just an example. You might handle your code in some
   cases like there is no value, etc. If not, your code might break somehow.
 * Cheers,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding extra fields to WPJM’ is closed to new replies.

 * ![](https://ps.w.org/wp-job-manager/assets/icon-256x256.gif?rev=2975257)
 * [WP Job Manager](https://wordpress.org/plugins/wp-job-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-job-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-job-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-job-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-job-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-job-manager/reviews/)

## Tags

 * [extra fields](https://wordpress.org/support/topic-tag/extra-fields/)

 * 3 replies
 * 3 participants
 * Last reply from: [Dat Hoang](https://wordpress.org/support/users/htdat/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/adding-extra-fields-to-wpjm/#post-9541161)
 * Status: resolved