Unsubscribe on profile update
-
Hi! First of all thank you for the plugin!
I’m trying to unsubscribe people if a custom field in their UPME profile filled. I tried to find how to do that reading your plugin but I’m a bit lost. Can you help me?This is what I have:
//hook profile updates add_action( 'profile_update', 'my_profile_update', 10, 2 ); //create the function. $user_id is the updated user id function my_profile_update( $user_id, $old_user_data ) { //get the custom field data and verify if it's empty $user_info = get_userdata($user_id); $custom_field = $user_info->custom_field; if (!empty($custom_field)){ //UNSUBSCRIBE FUNCTION HERE, run if field is empty } }
- The topic ‘Unsubscribe on profile update’ is closed to new replies.