Thread Starter
Chris
(@lamordnt)
I found where I can remove the value from being automatically inserted however if i update the plugin it will be overwritten.
In the file “class-wp-job-manager-writepanels.php” on line 40 it is adding a value to the application field. If I delete all of line 40 it takes care of the problem and stops automatically inserting the email address.
The code I am deleting is:
'value' => metadata_exists( 'post', $post->ID, '_application' ) ? get_post_meta( $post->ID, '_application', true ) : $current_user->user_email,
Is there a way to achieve this in my themes functions.php file so that i do not have to make this change to the plugin every time there is an update?
If you look at that code you’ll see its all wrapped in a filter. You can use the filter to adjust the value from a custom plugin/theme functions.php
Thread Starter
Chris
(@lamordnt)
Thanks for steering me in the right direction. I found documentation on the WP Job Manager site on how to do this here: https://wpjobmanager.com/document/editing-job-submission-fields/#section-2
For anyone else trying to achieve this you can just copy this code below and dump it into your functions.php file and it will stop auto-filling your email address into the application field:
add_filter( 'job_manager_job_listing_data_fields', 'remove_email_job_manager_job_listing_data_fields' );
function remove_email_job_manager_job_listing_data_fields( $fields ) {
$fields['_application']['value'] = "";
return $fields;
}
Glad to hear you got things working!
Let me know if there’s anything else you need. 🙂 Thanks!
Thread Starter
Chris
(@lamordnt)
OK so this started to create a problem for me where it would not save any of the data I put into the apply field so I had to adjust the code like so:
// Add filter to prevent job manager from automatically insterting email address into field in the admin area
add_filter( 'job_manager_job_listing_data_fields', 'remove_email_job_manager_job_listing_data_fields' );
function remove_email_job_manager_job_listing_data_fields( $fields ) {
$fields['_application']['placeholder'] = "Apply link or URL";
return $fields;
}
So far this seems to be working better.