mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
7 lines
293 B
Text
7 lines
293 B
Text
add_action('profile_update', 'remove_billing_email_on_profile_update', 10, 2);
|
|
|
|
function remove_billing_email_on_profile_update($user_id, $old_user_data) {
|
|
if (isset($_POST['billing_email']) && empty($_POST['billing_email'])) {
|
|
delete_user_meta($user_id, 'billing_email');
|
|
}
|
|
}
|