Hi all. Caveat: I have only had a couple of weeks with WordPress and do not code php.
Fatal error: call to member function has_cap on a non-object /home/…/capa.php on line 990
While this relates to an error I receive when I activate a (would-be perfect) plugin (CaPa Protect), it is more of a general question regarding the function has_cap() and function calls in php, in general. While doing some searching for the function has_cap(), I have found what appears to be the function in two places: 1) wp-includes/capabilities.php and 2)wp-includes/wp-db.php. Just looking at the code, they seem to be different functions with the same name – both at the same hierarchical level, folder-wise.
1. Are they, in fact, different? I think so, since one seems to relate to user roles-capabilities and the other seems to relate to SQL database “stuff”, but I may be confused.
2. Is there a (php for dummies) way to set up some sort of path within a file (e.g. capa.php) which would direct the has_cap() function call to the correct place? Assuming that would be the correct approach.
3. Or, is one (or a portion of one) of the two listed php files some sort of legacy code that should be deleted?
4. Or am I way off track? Most likely answer is “yes”.
Any advice for any of the above questions would be greatly appreciated and new knowledge to me. Thanks, in advance.
- The topic ‘Fatal error: call to member function has_cap on a non-object’ is closed to new replies.