Created
May 6, 2019 22:12
-
-
Save tripflex/34704770b43c06eddf8ae9584634a208 to your computer and use it in GitHub Desktop.
Remove auto populate current user email for application meta key in admin area on new listings for WP Job Manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'job_manager_job_listing_data_fields', 'smyles_remove_auto_populate_application_email', 999999999, 2 ); | |
/** | |
* Remove Auto Populate application meta key with user email in admin area | |
* | |
* @see https://github.com/Automattic/WP-Job-Manager/issues/1591 | |
* | |
* @param $fields | |
* @param $post_id | |
* | |
* @return array | |
*/ | |
function smyles_remove_auto_populate_application_email( $fields, $post_id ){ | |
if( isset( $fields['_application'] ) && ! metadata_exists( 'post', $post_id, '_application' ) ){ | |
$fields['_application']['value'] = ''; | |
} | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment