Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created May 6, 2019 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/34704770b43c06eddf8ae9584634a208 to your computer and use it in GitHub Desktop.
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
<?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