Notifications
Clear all

Update to Ultimate Member Integration Code

2 Posts
2 Users
1 Likes
1,822 Views
 Who
(@amor)
Member Customer
Joined: 7 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: 9 years ago
Posts: 4172
 

Thank you for sharing this change.


   
ReplyQuote
Share:
Scroll to top