@rsasbeih
Seems like your meta key of the field you want to remove is not correct.
Should be like this:
add_filter( 'submit_job_form_fields', 'remove_location_option' );
function remove_location_option( $fields ) {
//remove the remote_position field
unset($fields['job']['job_location']);
return $fields;
}
-
This reply was modified 3 years, 10 months ago by
braehler.
-
This reply was modified 3 years, 10 months ago by
braehler.
@braehler is correct here. You are using the wrong key for the field.
I’d recommend using a plugin like Code Snippets to add this code to your site, rather than adding it directly to functions.php:
* https://ww.wp.xz.cn/plugins/code-snippets/
Please try updating your code and then mark this thread “resolved” if your issue is fixed.
If you need additional assistance beyond this, you can search for development help in a variety of places — here is one to start:
http://jobs.wordpress.net/
Assisting with customization is outside of the scope of the support that we can offer, per our [Support Policy](https://wpjobmanager.com/support-policy/).
@braehler Thanks for the help!
How can I know what the meta name for an attribute is?
Hi @rsasbeih,
You can get that from the WordPress REST API, you can find more information on that here:
https://wpjobmanager.com/document/wp-job-manager-rest-api/
I’m having trouble removing fields from the job submission page. For example, I would like to remove the ‘Job_salary’ field, so I added this snippet to the code snippet file as I’ve seen in the documentation. However, nothing happens and the ‘salary” field remains. not sure i have the tags correct. Any ideas?
I did have success in removing the Company twitter:
add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields_dm' );
function custom_submit_job_form_fields_dm( $fields ) {
// in this example, we remove the job_tags field
unset($fields['job']['job_listing_salary']);
unset($fields['company']['company_twitter']);
// And return the modified fields
return $fields;
}
Hi @kcassuto,
Could you please start your own thread, as per the Forum Welcome?
https://ww.wp.xz.cn/support/plugin/jetpack#new-post
Please notice that assisting with such customizations is outside the scope of the support we can offer, per our [Support Policy](https://wpjobmanager.com/support-policy/).
Thank you!
@kcassuto
You´re also using the wrong meta.
This should be in your case job_salary