Skip to content

Instantly share code, notes, and snippets.

@ultimatemember
ultimatemember / gist:6c8d18b2b0869662d203
Last active August 29, 2015 14:15
Check when user updates e-mail via account page
add_action('um_account_pre_update_profile', 'did_user_change_email', 10, 2 );
function did_user_change_email( $changes, $user_id ) {
$data = get_userdata($user_id);
if ( isset( $changes['user_email'] ) && $data->user_email != $changes['user_email'] ) {
// user e-mail changed! Do something
}
}
@ultimatemember
ultimatemember / gist:cebf7407ea1c93dea904
Last active August 29, 2015 14:15
Control the output of a textfield using UM filter hooks
/*
This is a sample filter that assumes your textfield meta key is "buttoncode"
The filter below allow you to change the output dynamically
to show a shortcode instead of the value entered for that field
Use in theme functions.php and do not have to rely on UM core
*/