-
-
Save tripflex/43aecac9a914e987b13c to your computer and use it in GitHub Desktop.
<?php | |
// 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; | |
} |
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;
}
Hi! hoping someone can point me in the right direction. Stumbled across this looking for an answer. I'm using jobify theme with wp job manager and I wanted to rem out some fields in the job listing form. (File: class-wp-job-manager-form-submit-job.php) I was able to find and rem out twitter, video and company website, but NOWHERE can I find the Google+ or Linkedin on here. Very odd...you'd think it would be in the same group as the rest but it's not. I've scanned and searched the code several times thinking I must be crazy, but indeed, it's not there!? I referenced the other file in the directory which didn't appear to have it either. I know enough about php to be dangerous. If someone can enlighten me on where these fields are, that'd be great. Thanks so much!
Try this code
add_filter('user_contactmethods', function($methods) {
// list of items to remove
$unset_items = ['pinterest', 'linkedin', 'github'];
foreach($unset_items as $item) {
unset($methods[$item]);
}
return $methods;
}, 20); // priority 20 to make sure this runs after listify_user_contactmethods
@jeffvee thanks for that...being my OP was from 2017 I think I got it figured out. Appreciate your input though, I'll keep it for future reference ;-)
OP
np =) seems people are still having issue with removing them (even I was), so hope this helps others.
Hi!
hoping someone can point me in the right direction. Stumbled across this looking for an answer. I'm using jobify theme with wp job manager and I wanted to rem out some fields in the job listing form. (File: class-wp-job-manager-form-submit-job.php) I was able to find and rem out twitter, video and company website, but NOWHERE can I find the Google+ or Linkedin on here. Very odd...you'd think it would be in the same group as the rest but it's not. I've scanned and searched the code several times thinking I must be crazy, but indeed, it's not there!? I referenced the other file in the directory which didn't appear to have it either.
I know enough about php to be dangerous. If someone can enlighten me on where these fields are, that'd be great.
Thanks so much!