• Resolved coyotito

    (@coyotito)


    I tried to remove Location in front end when submitting Job and in the backend part using the following code but it doesn’t work.

    Can someone help me with this please?

    add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields' );
    
    function custom_submit_job_form_fields( $fields ) {
        unset( $fields['location'] );
        return $fields;
    }

    https://www.ads-software.com/plugins/wp-job-manager/

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Close; try [‘job’][‘job_location’]

    Thread Starter coyotito

    (@coyotito)

    Thank you. That did the magic on the frontend.

    How about the backend?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Admin would use the filter ‘job_manager_job_listing_data_fields’ instead of ‘submit_job_form_fields’ and the field would be [‘_job_location’]

    Hope that helps

    Thread Starter coyotito

    (@coyotito)

    WOW!! That was so perfect! I love it.

    I would like to hide location in resumes too for both front & backend. Which filter and field are to be applied? I seem not to find them.

    Thank you.

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    I believe its resume_manage_resume_data_fields and just _location. You can view the source to double check ??

    Thread Starter coyotito

    (@coyotito)

    Thank you.
    Still couldn’t find them out on source code!.
    The code below didn’t work on both ends:

    add_filter( 'resume_manage_resume_data_fields', 'custom_hide_resume_form_fields' );
    function custom_hide_resume_form_fields( $fields ) {
        unset( $fields['_location'] );
        return $fields;
    }

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Here are the hook names https://github.com/mikejolley/WP-Job-Manager/wiki/resume-manager#advanced-editing-resume-submission-fields

    The frontend one is [‘resume_fields’][‘candidate_location’]

    The admin one is just _candidate_location

    Thread Starter coyotito

    (@coyotito)

    Oh! The frontend one was perfect!

    For the backend, what do you mean by just _candidate_location?
    Do you mean something like unset( $fields[_candidate_location] );?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    unset( $fields['_candidate_location'] );

    Base it on the snippet from before.

    Thread Starter coyotito

    (@coyotito)

    Thank you. I’m using this code to hide location in backend for resumes but it’s failing. Am I missing something? Am i using the wrong filter maybe?

    add_filter( 'submit_resume_form_fields', 'custom_hide_resume_form_fields' );
    function custom_hide_resume_form_fields( $fields ) {
        unset( $fields['_candidate_location'] );
        return $fields;
    }

    Once again, thank you for your support.

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    add_filter( 'resume_manager_resume_fields', 'custom_resume_manager_resume_fields' );
    function custom_resume_manager_resume_fields( $fields ) {
        unset( $fields['_candidate_location'] );
        return $fields;
    }
    Thread Starter coyotito

    (@coyotito)

    GREAT! That one again was perfect.

    Thank you very much.

    Hi Coyotito, would you be interested in sharing the exact codes you used and where to get rid of location?

    many thanks!

    Thread Starter coyotito

    (@coyotito)

    /** Jobs Remove Location Frontend

    add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields' );
    function custom_submit_job_form_fields( $fields ) {
        unset( $fields['job']['job_location'] );
        return $fields;
    }

    /**Jobs Remove Location Backend

    add_filter( 'job_manager_job_listing_data_fields', 'custom_hide_job_form_fields' );
    function custom_hide_job_form_fields( $fields ) {
        unset( $fields['_job_location'] );
        return $fields;
    }

    /** Resume Remove Location Frontend

    add_filter( 'submit_resume_form_fields', 'custom_submit_resume_form_fields' );
    function custom_submit_resume_form_fields( $fields ) {
        unset( $fields['resume_fields']['candidate_location'] );
        return $fields;
    }

    /** Resume Remove Location Backend

    add_filter( 'resume_manager_resume_fields', 'custom_resume_manager_resume_fields' );
    function custom_resume_manager_resume_fields( $fields ) {
        unset( $fields['_candidate_location'] );
        return $fields;
    }

    Top man! Thanks for that. Would be really interested in seeing your job site! Cheers

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Remove Location in Job Submit form and in the Backend’ is closed to new replies.