Notifications
Clear all

Limited Support

Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed. We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.

 

Update to Ultimate Member Integration Code

2 Posts
2 Users
1 Reactions
2,365 Views
 Who
(@amor)
Member Customer
Joined: 8 years ago
Posts: 20
Topic starter  

I had to make a change to the integration code to deal with deleted users so I decided share what I did since I know integration code will not be a priority. If I deleted a user, their comments would show with a blank author. The current integration code has the following line:

if ($comment->user_id) {

but the problem with that is that all comments that were posted by registered users will have a user_id whether or not the user still exists.

I had to change the code to the following for it to work for deleted users:

if (get_userdata($comment->user_id)) {

   
Tom reacted
Quote
 Tom
(@tomson)
Famed Member Admin
Joined: 10 years ago
Posts: 4233
 

Thank you for sharing this change.


   
ReplyQuote
Share:
Scroll to top