PHP Trying to get property of non-object Error
-
I’m not sure if this is true to all installations or just when the WP_DEBUG is enabled, but when attempting to run the plugin PHP returns the following error:
Trying to get property of non-object on line 69
To fix this I just modified line 69 to also look for if $user isset and modified it to treat $user as an array not an object like the code below:
if (!isset($user) || (isset($user) && $user[‘user_level’] < 10) ) $user = $current_user;
The plugin still did what it was supposed to do, it just threw that error rather than taking me to the dashboard.
Hope this helps!
- The topic ‘PHP Trying to get property of non-object Error’ is closed to new replies.