weDevsOfficial / wp-user-frontend

A WordPress plugin that brings many backend functionality to the site frontend
https://wordpress.org/plugins/wp-user-frontend/
227 stars 146 forks source link

Warning: Attempt to read property "roles" ........................ wpuf-functions.php on line 4663 #1452

Open kabirbd89 opened 6 months ago

kabirbd89 commented 6 months ago

Getting this error on few of my post. And some of my page are already indexing with the following error.

Error on post Warning: Attempt to read property "roles" on bool in /home1/**********/wp-content/plugins/wp-user-frontend/wpuf-functions.php on line 4663

And Code on 4663 Line, return ( array ) $user->roles;

function wpuf_get_single_user_roles( $user_id ) { if ( ! is_numeric( $user_id ) ) { return false; }

$user = get_user_by( 'id', $user_id );

return ( array ) $user->roles;

}

kabirbd89 commented 5 months ago

anyone here !

anik-fahmid commented 5 months ago

@kabirbd89 can you provide some screenshots/video recording as reference?