• Resolved Triptikon

    (@triptikon)


    Hello. How can I create an employer phone number field in the new job posting form? It is very strange that the email field is there, but the phone number field is missing. Also interested in the issue of editing existing fields. For example, I don’t need the Twitter field at all

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hi @triptikon!

    There are three ways to customize the job submission form fields in the WP Job Manager core plugin:

    A) For simple text changes, use a plugin such as Loco Translate (it can also “translate” text into different words in the same language):

    https://www.ads-software.com/plugins/loco-translate/

    B) For field changes, or to add or remove fields, use functions and/or filters inside a functionality plugin:

    https://wpjobmanager.com/document/editing-job-submission-fields/

    https://css-tricks.com/wordpress-functionality-plugins/

    Here’s an example tutorial:

    https://wpjobmanager.com/document/tutorial-adding-a-salary-field-for-jobs/

    C) Use a third-party plugin such as WP Job Manager Field Editor, which has a nice GUI for editing fields.

    Thanks!

    Thread Starter Triptikon

    (@triptikon)

    Thanks, but unfortunately, I’m not so good at coding to fully solve my questions in this case. So please tell me what code you need to add in order to:

    1. Remove the Twitter field
    2. Remove the field “Company video”
    3. Remove the field “Company website”
    4. Add field “Phone number”

    Plugin Contributor Cena (a11n)

    (@cena)

    Hi @triptikon ,

    > I’m not so good at coding to fully solve my questions in this case.

    Your best bet in that case is to use a plugin like WPJM Field Editor, which Aicee recommended. That allows you to do this with ease.

    Otherwise, it requires custom code, which is outside of our scope of support. Aicee provided some helpful tutorials, but they do require some coding knowledge, I’m afraid.

    Best,
    Cena

    Thread Starter Triptikon

    (@triptikon)

    @cena can you just give a code for these items then? Because WPJM Field Editor price is rather high

    Plugin Contributor Cena (a11n)

    (@cena)

    Hi,

    Unfortunately we cannot provide code for this, other than the tutorials we have already pointed out.

    Best,
    Cena

    Thread Starter Triptikon

    (@triptikon)

    @cena tell me at least the shortcodes of these fields if you refuse to give a proper support of your own plugin

    @triptikon
    take a look at this code. based on the listify theme, but should works for your theme as well:

    // Add your own function to filter the fields
    add_filter( 'submit_job_form_fields', 'remove_listify_submit_job_form_fields', 9999999999 );
    
    // 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 remove_listify_submit_job_form_fields( $fields ) {
    
        if( ! isset( $fields['company'] ) ) return $fields;
    
        // If phone, company_website, or company_video fields exist in company array, remove them
        if( isset( $fields['company']['phone'] ) ) unset( $fields['company']['phone']);
        if( isset( $fields['company']['company_website'] ) ) unset( $fields['company']['company_website']);
        if( isset( $fields['company']['company_video'] ) ) unset( $fields['company']['company_video']);
    
        // And return the modified fields
        return $fields;
    }

    Adding a field is sescribed in the cusomizations snippets of the docs like said before

    • This reply was modified 2 years, 6 months ago by braehler.

    @triptikon
    shorter way to remove company details from the job submission flow is this one here

    dd_filter( 'submit_job_form_fields', 'gma_custom_submit_job_form_fields' );
    
    function gma_custom_submit_job_form_fields( $fields ) {
        
        unset($fields['company']['company_name']);
        unset($fields['company']['company_website']);
        unset($fields['company']['company_tagline']);
        unset($fields['company']['company_video']);
        unset($fields['company']['company_twitter']);
        unset($fields['company']['company_logo']);
    
        return $fields;
    }

    code belongs to your chid_themes function.php

    Thread Starter Triptikon

    (@triptikon)

    @braehler thanks, but it doesn’t work. Fields remain at the same places

    @triptikon
    sorry I′d miss a letter on my code above

    add_filter( 'submit_job_form_fields', 'gma_custom_submit_job_form_fields' );
    
    function gma_custom_submit_job_form_fields( $fields ) {
        
        unset($fields['company']['company_name']);
        unset($fields['company']['company_website']);
        unset($fields['company']['company_tagline']);
        unset($fields['company']['company_video']);
        unset($fields['company']['company_twitter']);
        unset($fields['company']['company_logo']);
    
        return $fields;
    }
    Thread Starter Triptikon

    (@triptikon)

    @braehler I noticed the missing letter at once, but it still doesn’t work)

    @triptikon

    just tested it on one of my sites. Try the first one I mentined, this one works

    Thread Starter Triptikon

    (@triptikon)

    @braehler this one doesn’t work too unfortunately

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to add phone number field?’ is closed to new replies.