Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Simple-press profile email is not synced with wordpress profile
Avatar
Yehonal
Member
sp_UserOfflineSmall Offline
Jun 16, 2017 - 9:53 am

I've noticed that after a profile update, the wordpress email is not updated.

Is it a normal behaviour? 

 

however currently i'm using sph_UpdateProfileSettings filter with this instruction:

wp_update_user( array( 'ID' => $thisUser, 'user_email' => $_POST['email'] ) );

 

I've also noticed that this filter have only the user id as parameter but if i've to retrieve the email i should use the $_POST variable.

Won't be better to pass the updated user object with new email ?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 16, 2017 - 12:18 pm

Yehonal said
I've noticed that after a profile update, the wordpress email is not updated.
Is it a normal behaviour? 

Really? It does for me and, as far as I am aware, all of our other users...

however currently i'm using sph_UpdateProfileSettings filter with this instruction:

wp_update_user( array( 'ID' => $thisUser, 'user_email' => $_POST['email'] ) );

I've also noticed that this filter have only the user id as parameter but if i've to retrieve the email i should use the $_POST variable.

Won't be better to pass the updated user object with new email ?  

Possibly I would have to check the code but we can't change an existing filter in case it is being used by anyone.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 16, 2017 - 7:51 pm

you can get the user object from the user id that is passed...  we dont actually update a user object per se, we update the info in the database directly... so if we were to want to pass the user object, we would have to fetch it from the database... and this would be an additional db query just for passing in the filter...  seems kind of a wasteful query if its not used within the code... seems more prudent for the filter receiving end to do the query if needed...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626