Occurred php warning when remove user on profile screen
-
Hi,
It is occurred php warning as follows when remove user on profile screen with this plugin.
reset() expects parameter 1 to be array, null given in ~/theme-my-login/modules/themed-profiles/themed-profiles.php on line 299
If user deletion on profile screen, since $profileuser of arguments to be empty, then I think that it sould be checking the $profileuser object has property. I modified as follows, then I did prevent the error successfully. I want you to merge it.
- $user_role = reset( $profileuser->roles ); + $user_role = isset( $profileuser->roles ) && is_array( $profileuser->roles ) ? reset( $profileuser->roles ) : 'subscriber';
Thank you,
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Occurred php warning when remove user on profile screen’ is closed to new replies.