Skip to content

Instantly share code, notes, and snippets.

@jfeliweb
Forked from tripflex/functions.php
Created May 3, 2017 20:57
Show Gist options
  • Save jfeliweb/eb11c8801935231bc722dfbe9e60f0a0 to your computer and use it in GitHub Desktop.
Save jfeliweb/eb11c8801935231bc722dfbe9e60f0a0 to your computer and use it in GitHub Desktop.
How to remove default company fields from WP Job Manager (this example for Listify)
<?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;
}
@jfeliweb
Copy link
Author

jfeliweb commented May 3, 2017

Works great with WPJobManager Jobs and Company fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment