WordPress.org

Forums

WP Job Manager
[resolved] edit/remove fields in job form (19 posts)

  1. dti06
    Member
    Posted 1 year ago #

    Hi,

    I don't need all fields and I'd like to hide/remove some of them (ex: job_location)
    Is it possible to customize the form within the functions.php file or should I modify one of your file ?

    Thank you for your great plugin!

    David

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

  2. Mike Jolley
    Member
    Plugin Author

    Posted 1 year ago #

  3. dti06
    Member
    Posted 1 year ago #

    ok, I tried this but nothing happened

    function supprimer_champs_inutiles($fields) {
    	unset($fields['company']['company_name']);
    	unset($fields['company']['company_website']);
    	return $fields;
    	}
    	add_filter('submit_job_form_fields', 'supprimer_champs_inutiles');

    appreciate any advice, I'm a kind of newbie

  4. dti06
    Member
    Posted 1 year ago #

    I think I wasn't clear in my question.
    I was talking about the form in the admin panel (WP_Job_Manager_Writepanels)
    I don't need to modify the front-end form because I won't use it, only the admin (me) will be able to post a new job.

    So, my question is: How do I remove fields in the admin "Ad job" post form "job informations"?
    I don't want to do it the hard way (removing some code in your files) because it would be a mess and tricky to maintain when making updates.

    ps: I've modified the front-end templates via mytheme/job_manager folder as requiered in your documentation. It would be great if I could do the something similar for the admin form.

  5. Mike Jolley
    Member
    Plugin Author

    Posted 1 year ago #

    Admin fields can be tweaked using the filter here: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/admin/class-wp-job-manager-writepanels.php#L24

    Same kind of thing as the frontend forms.

  6. dti06
    Member
    Posted 1 year ago #

    thank you so much, it works !

    If someone need to do it, here is an example:

    function delete_form_fields($fields) { // name your function whatever you want (here: delete_form_field)
    	unset($fields['_company_name']); // remove the field company name in the form
    	return $fields;
    	}
    	add_filter('job_manager_job_listing_data_fields', 'delete_form_fields');
  7. martyy
    Member
    Posted 1 year ago #

    dti06, i also would like to remove some fields, both back- and front-end.
    i tried your code from your last post and added it to the functions.php.
    however, nothing got removed.
    could your explain it once more which steps are necessary to remove a certain field on both ends? your help would be much appreciated!!!
    kr martin

  8. kfan21
    Member
    Posted 1 year ago #

    Hi,
    I too am trying to do remove fields from both the back and front end as well. More detailed steps would be so very helpful.

    Thank you in advance for your time!

  9. dti06
    Member
    Posted 1 year ago #

    I just follow explainations from Mikes on his Githubs page and hère in this post.
    If you want to remote fields in back,

    Just remove lines or tag them as comment. For example I don't wan't company fields (back and front)

    In the fonction.php I did:

    function delete_form_fields($fields) {
    	unset($fields['_company_name']);
    	unset($fields['_company_website']);
    	unset($fields['_company_tagline']);
    	unset($fields['_company_twitter']);
    	unset($fields['_company_logo']);
    	return $fields;
    	}
    	add_filter('job_manager_job_listing_data_fields', 'delete_form_fields');

    Then in my template content-single-job_listing.php (inside the job_manager folder in my theme), I just put corresponding lines in comment tag

    <!--
    		<div class="company" itemscope itemtype="http://data-vocabulary.org/Organization">
    			<?php the_company_logo(); ?>
    
    			<p class="name">
    				<a class="website" href="<?php echo get_the_company_website(); ?>" itemprop="url"><?php _e( 'Website', 'job_manager' ); ?></a>
    				<?php the_company_twitter(); ?>
    				<?php the_company_name( '<strong itemprop="name">', '</strong>' ); ?>
    			</p>
    			<?php the_company_tagline( '<p class="tagline">', '</p>' ); ?>
    		</div>
    -->

    Hope you can find out how to customize your fields now.

  10. orangemint123
    Member
    Posted 1 year ago #

    This is great and works fine except for _featured.

    I added `function delete_form_fields($fields) {
    unset($fields['_company_name']);
    unset($fields['_company_website']);
    unset($fields['_application']);
    unset($fields['_company_tagline']);
    unset($fields['_company_twitter']);
    unset($fields['_company_logo']);
    unset($fields['_filled']);
    unset($fields['_featured']);
    return $fields;
    }
    add_filter('job_manager_job_listing_data_fields', 'delete_form_fields');`

    which removes the fields from admin, but the submitted jobs then don't show up in the [jobs] page.
    If I remove _featured filter then it works fine.
    Any ideas? Or shall I just resort to removing it directly from the ...writepanels.php file?

  11. Mike Jolley
    Member
    Plugin Author

    Posted 1 year ago #

    You can unset featured, but you will need to hook in elsewhere and ensure the meta data _featured is set (to 0). WordPress does not let you do a query for postmeta when the value doesn't exist in the DB.

    I've logged an issue for that https://github.com/mikejolley/WP-Job-Manager/issues/159

  12. vfjohnson
    Member
    Posted 11 months ago #

    commenting the fields did not work for me. any other suggestions?

  13. dti06
    Member
    Posted 11 months ago #

    you did something wrong because it works fine.

  14. tripflex
    Member
    Posted 10 months ago #

    You can get a free beta license for my field editor plugin that will allow you to disable some of the default fields from the frontend:

    https://plugins.smyl.es/wp-job-manager-field-editor/

    Feature will soon be added to hide only on frontend or admin section but right now it will disable the field both admin and frontend.

  15. Tsutphen
    Member
    Posted 9 months ago #

    I used the code above and was able to remove the fields from the admin page, but how can I remove the company info fields from the submit jobs page?

  16. tripflex
    Member
    Posted 9 months ago #

    Use the plugin I mentioned above :P

  17. Tsutphen
    Member
    Posted 9 months ago #

    Just figured it out. sorry :)

    I was going to use your plugin first but I didn't see the free beta license listed anymore...

  18. tripflex
    Member
    Posted 9 months ago #

    Yeah I removed it a few days ago, was only available for a limited time until reached beta tester limit ... should have grabbed a license for yourself before it was removed :P

  19. biogeneius
    Member
    Posted 7 months ago #

    Does anyone know which file in the Jobify theme must be edited to remove their additional fields (Facebook, Linkedin, GooglePlus)?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Job Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic