• Resolved dti06

    (@dti06)


    Hi Mike,

    I’m trying to add a new field to the front/back. My field appears in the admin but not in front.

    I’ve followed your step by step method:

    add_filter( 'submit_job_form_fields', 'frontend_add_rh_field' );
    
    	function frontend_add_rh_field( $fields ) {
        $fields['job']['job_rh'] = array(
            'label'       => __( 'Personne à contacter', 'job_manager' ),
            'type'        => 'text',
            'required'    => false,
            'placeholder' => 'Nom de la personne à contacter',
            'priority'    => 7
        	);
        	return $fields;
    	}
    
    	add_action( 'job_manager_update_job_data', 'frontend_add_rh_field_save', 10, 2 );
    
    	function frontend_add_rh_field_save( $job_id, $values ) {
        	update_post_meta( $job_id, '_job_rh', $values['job']['job_rh'] );
    	}
    
    	add_filter( 'job_manager_job_listing_data_fields', 'admin_add_rh_field' );
    
    	function admin_add_rh_field( $fields ) {
        $fields['_job_rh'] = array(
            'label'       => __( 'Personne à contacter', 'job_manager' ),
            'type'        => 'text',
            'placeholder' => 'Nom de la personne à contacter',
            'description' => ''
        	);
        	return $fields;
    	}

    What did I wrong ?

    http://wordpress.org/plugins/wp-job-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding a new field’ is closed to new replies.