Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
An object in PHP is a data type that you can read more data types here It’s good practice to check variable types before using them. In your case, you are assuming $user_meta is an object. Since you are filtering the_content(), it might be called some place else and returning that error. Here is your … Read more