• Resolved georgehcook

    (@georgehcook)


    I am trying to remove several of the company fields. Following the tutorial, I used this in my theme’s functions.php file:

    add_filter( ‘submit_job_form_fields’, ‘remove_job_form_fields’ );
    function remove_job_form_fields( $fields ) {
    unset($fields[‘company’][‘company_logo’]);
    unset($fields[‘company’][‘company_tagline’]);
    unset($fields[‘company’][‘company_twitter’]);
    unset($fields[‘company’][‘company_video’]);
    return $fields;
    }

    However, it did not remove any of those fields. What I am doing wrong?

Viewing 5 replies - 1 through 5 (of 5 total)
  • @georgehcook

    this one here should work

    add_filter( 'submit_job_form_fields', 'gma_custom_submit_job_form_fields');

    functiongma_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;

    }

    Plugin Contributor Cena (a11n)

    (@cena)

    Hi @georgehcook ,

    A couple of notes here:

    1 – we recommend placing custom code in a plugin like Code Snippets instead of directly into functions.php. The main reasons for that are: a) the code will be overwritten in functions.php on any theme update, and b) if you enter bad/incorrect code, Code Snippets makes it easier to recover from the ensuing site crash.

    2 – you might also look at this plugin: WP Job Manager Field Editor. We don’t make it, and it’s a paid plugin, but it makes customizing your various form fields in WPJM much easier.

    We don’t provide support for custom code, so thanks, @braehler , for stepping in! ??

    Best,

    Thread Starter georgehcook

    (@georgehcook)

    @braehler, that’s pretty much the same code I used (I just used a different function name), and it does not work for me. I even changed the function name to be the same, and it did not work.

    @cena, I understand. I was trying to do this without installing another plugin, as my office already has to manage updates to 100+ different plugins, and it is a major time suck. (And where I work, there is so much administrative overhead involved in paying for paid plugins that it’s just not an option for me.)

    Thread Starter georgehcook

    (@georgehcook)

    I have solved the problem. This is the code that works. The key confusion is that I am removing it from the jobs dashboard. I didn’t have a good enough understanding of the nomenclature, so was removing them from the wrong place.

    add_filter(‘job_manager_job_listing_wp_admin_fields’,’remove_job_form_fields’);
    function remove_job_form_fields($fields) {
    unset($fields[‘_company_tagline’]);
    unset($fields[‘_company_video’]);
    unset($fields[‘_company_twitter’]);
    unset($fields[‘_filled’]);
    unset($fields[‘_featured’]);
    return $fields;
    }

    Plugin Support lastsplash (a11n)

    (@lastsplash)

    Hi @georgehcook

    I’m glad that you got this resolved. Thanks also for sharing the code, it may help others in the future.

    I’m glad that you got this sorted out.

    If you have additional questions about WPJM in the future, feel free to open a new thread.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Unable to remove fields’ is closed to new replies.