function test_delete_user_social_profile() { $insert_id = wsl_store_hybridauth_user_profile($this->someUserID, $this->someUserIDP, $this->someUserProfile); $profile = (array) wsl_get_stored_hybridauth_user_profiles_by_user_id($this->someUserID); $this->assertEquals(1, count($profile)); wp_delete_user($this->someUserID); $profile = (array) wsl_get_stored_hybridauth_user_profiles_by_user_id($this->someUserID); $this->assertEquals(0, count($profile)); }
/** * Store WSL user data * * Steps: * 1. Store Hybridauth user profile * 2. Import user contacts * 3. Launch BuddyPress Profile mapping */ function wsl_process_login_update_wsl_user_data($is_new_user, $user_id, $provider, $adapter, $hybridauth_user_profile, $wp_user) { // HOOKABLE: do_action("wsl_process_login_update_wsl_user_data_start", $is_new_user, $user_id, $provider, $adapter, $hybridauth_user_profile, $wp_user); // store user hybridauth user profile in table wslusersprofiles // > wsl will only sotre the user profile if it has changed since last login. wsl_store_hybridauth_user_profile($user_id, $provider, $hybridauth_user_profile); // map hybridauth user profile to buddypress xprofile table, if enabled // > Profile mapping will only work with new users. Profile mapping for returning users will implemented in future version of WSL. if ($is_new_user) { wsl_buddypress_xprofile_mapping($user_id, $provider, $hybridauth_user_profile); } // import user contacts into wslusersprofiles, if enabled // > wsl will only import the contacts list once per user per provider. wsl_store_hybridauth_user_contacts($user_id, $provider, $adapter); }