Title: rustyrust's Replies | WordPress.org

---

# rustyrust

  [  ](https://wordpress.org/support/users/rustyrust/)

 *   [Profile](https://wordpress.org/support/users/rustyrust/)
 *   [Topics Started](https://wordpress.org/support/users/rustyrust/topics/)
 *   [Replies Created](https://wordpress.org/support/users/rustyrust/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/rustyrust/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/rustyrust/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/rustyrust/engagements/)
 *   [Favorites](https://wordpress.org/support/users/rustyrust/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] WP editor on job submission](https://wordpress.org/support/topic/wp-editor-on-job-submission/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wp-editor-on-job-submission/#post-5123596)
 * Hey,
 * I’ve just copied the wp-editor-field.php to /my_theme/job_manager/ and made a
   small changes:
 *     ```
       <?php
       $editor = apply_filters( 'submit_job_form_wp_editor_args', array(
       	'textarea_name' => isset( $field['name'] ) ? $field['name'] : $key,
       	'media_buttons' => false,
       	'textarea_rows' => 8,
       	'quicktags'     => false,
       	'tinymce'       => array(
       		'plugins'                       => '',
       		'paste_as_text'                 => true,
       		'paste_auto_cleanup_on_paste'   => true,
       		'paste_remove_spans'            => true,
       		'paste_remove_styles'           => true,
       		'paste_remove_styles_if_webkit' => true,
       		'paste_strip_class_attributes'  => true,
       		'theme_advanced_buttons1'       => 'bold, italic',
       		'theme_advanced_buttons2'       => '',
       		'theme_advanced_buttons3'       => '',
       		'theme_advanced_buttons4'       => ''
       	),
       ) );
       wp_editor( isset( $field['value'] ) ? esc_textarea( $field['value'] ) : '', $key, $editor );
       ```
   
 * All the buttons are still shown.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] Custom Fields](https://wordpress.org/support/topic/custom-fields-129/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-fields-129/#post-5000603)
 * Ok I’ve tried with the following code, problem is that the trailing slash isn’t
   working.
 *     ```
       add_filter( 'submit_job_form_save_job_data', 'custom_submit_job_form_save_job_data', 10, 5 );
       function custom_submit_job_form_save_job_data( $data, $post_title, $post_content, $status, $values ) {
   
         $job_slug   = array();
   
         // Prepend region
         if ( ! empty( $values['job']['job_region'] ) )
           $job_slug[] = $values['job']['job_region'];  
   
         // Prepend with company name
         if ( ! empty( $values['company']['company_name'] ) )
           $job_slug[] = $values['company']['company_name'];
   
         $job_slug[] = $post_title; 
   
         $data['post_name'] = implode( '/', $job_slug );
   
         return $data;
       }
       ```
   
 * Result to: [http://mywebsite.com/jobs/californiaapplevisual-designer](http://mywebsite.com/jobs/californiaapplevisual-designer)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] Custom Fields](https://wordpress.org/support/topic/custom-fields-129/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-fields-129/#post-5000602)
 * Indeed, it does! Thank you so much 🙂
 * Now I’m trying to add this field’s value to jobs permalinks using the filter 
   function do you think that would be possible? Something like:
 * [http://mywebsite.com/jobs/california/apple/visual-designer](http://mywebsite.com/jobs/california/apple/visual-designer)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] Shortcode alternative in templates](https://wordpress.org/support/topic/shortcode-alternative-in-templates/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/shortcode-alternative-in-templates/#post-5025160)
 * Job dashboard and resume dashboard.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] Custom Fields](https://wordpress.org/support/topic/custom-fields-129/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-129/#post-5000549)
 * Did that, I added new jobs but still output numbers. I give up.
 * Thanks anyway.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] Custom Fields](https://wordpress.org/support/topic/custom-fields-129/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-129/#post-5000519)
 * I don’t think so because it also output a number…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] Custom Fields](https://wordpress.org/support/topic/custom-fields-129/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-129/#post-5000487)
 * Then what will the code be like for output ?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] Custom Fields](https://wordpress.org/support/topic/custom-fields-129/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-129/#post-5000479)
 * I removed the plugin and just working on your way now. Here’s my code
 *     ```
       add_filter( 'submit_job_form_fields', 'frontend_add_region_field' );
   
       function frontend_add_region_field( $fields ) {
         $fields['job']['job_region'] = array(
           'label' => 'Job Region',
           'type' => 'select',
           'required' => true,
           'options' => array ( 'Choose a region', 'California', 'Palto Alto', 'Another Example' ),
           'placeholder' => '',
           'priority' => 3
         );
         return $fields;
       }
   
       add_action( 'job_manager_update_job_data', 'frontend_add_region_field_save', 10, 2 );
   
       function frontend_add_region_field_save( $job_id, $values ) {
         update_post_meta( $job_id, '_job_region', $values['job']['job_region'] );
       }
       ```
   
 * Now when I use
 * `<?php echo get_post_meta( $post->ID, '_job_region', true ); ?>`
 * It returns a number “2” corresponding to the second value of the select list “
   Palto Alto” in our example which it is true. Now how to convert this to a text
   value and show Palto Alto instead of the number ?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] Custom Fields](https://wordpress.org/support/topic/custom-fields-129/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-129/#post-5000358)
 * print_r(get_post_meta( $post->ID, ‘custom_field_slug’, true )); return nothing.
 * Here’s a bit of code from the plugin:
 *     ```
       $field_id    = get_the_ID();
       $field_slug  = get_post_meta( $field_id, 'wpjmcf_field_slug', true );
       $field_type  = get_post_meta( $field_id, 'wpjmcf_field_type', true );
       $field_value = get_post_meta( $job_id, $field_slug, true );
       $options     = explode(",",get_post_meta( $field_id, 'wpjmcf_field_options', true ) );
   
       $out .= '<strong>'.get_the_title() . ':</strong> ';
   
       switch ( $field_type ) {
       case 'textarea':
       $out .= '<br />'.$field_value;
       break;
       case 'checkbox':
       if( 1 == $field_value ) {
       $out .= __( 'Yes', 'wpjmcf' );
       } else {
       $out .= __( 'No', 'wpjmcf' );
       }
       break;
       case 'file':
       $out .= '<a href="'.$field_value.'" target="_blank">'.__( 'Download', 'wpjmcf' ).'</a>';
       break;
       case 'select':
       $out .= $options[ $field_value ];
       break;
   
       default:
       $out .= get_post_meta( $job_id, $field_slug, true );
       break;
       }
       ```
   
 * Does that give you an idea ? The “$options[ $field_value ];” doesn’t make sense
   for me.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Job Manager] Custom Fields](https://wordpress.org/support/topic/custom-fields-129/)
 *  Thread Starter [rustyrust](https://wordpress.org/support/users/rustyrust/)
 * (@rustyrust)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-129/#post-5000302)
 * Hey Mike,
 * Thanks for the fast response. With Remi’s plugin, I couldn’t manage to output
   the value with get_post_meta when the custom field type is a select list. I tried
   this;
 * `<?php $myvalue = explode(",", get_post_meta( $post->ID, 'custom_field_slug',
   true ) ); print_r($myvalue); ?>`
 * I’m i doing something wrong ? The get_post_meta is working fine however with 
   text fields.
 * `<?php echo get_post_meta( $post->ID, 'custom_field_slug', true ) ?>`
 * Got another question for you, I use a custom function that filter some custom
   fields to change their priorities and it’s working fine. Is it possible to move
   a custom field to the “Company details” section on job submission ?

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