Fatal Error add_cap() on a non-object in v 2.3.1
-
After updating one of my two multi-site installs was failing with the error:
PHP Fatal error: Call to a member function add_cap() on a non-object in /…/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 1697
This was simple enough for me to fix with:
if (is_object($role)) $role->add_cap( 'aiosp_manage_seo' );
I’m not sure I get why the line above
$role = get_role( 'administrator' );
was returning null in the first place. Looking in the database both sites have the role defined under wp_options with the key ‘***_wp_user_roles’.Any thoughts?
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Fatal Error add_cap() on a non-object in v 2.3.1’ is closed to new replies.