• Resolved nbacker

    (@nbacker)


    Hey All!

    I am trying to edit the names of some of the fields in the stock WP Job Manager form. Additionally, I want to edit some of the placeholder values and descriptions. I entered the below code in my functions.php file and saved it, but the fields themselves do not end up changing.

    // Add your own function to filter the fields
    add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields' );
    
    // This is your function which takes the fields, modifies them, and returns them
    // You can see the fields which can be changed here: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/forms/class-wp-job-manager-form-submit-job.php
    function custom_submit_job_form_fields( $fields ) {
    
        // Here we target one of the job fields (job_title) and change it's label
        $fields['job']['job_title']['label'] = "Custom Label";
    
        // And return the modified fields
        return $fields;
    }

    For the record, the following works for removing fields:

    add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields_dm' );
    
    function custom_submit_job_form_fields_dm( $fields ) {
        // in this example, we remove the job_tags field
        unset($fields['company']['company_tagline']);
        unset($fields['job']['job_hours']);
        // unset($fields['job']['job_title']);
    
        // And return the modified fields
        return $fields;
    }

    For some reason, the editing fields is not working, but the removing fields part does. Does anyone have any idea why this would be??

    Thanks so much for your help everyone!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Edit Form Fields’ is closed to new replies.