calling is_user_logged_in() when logged-out throws PHP notice
|Reported by:||wonderboymusic||Owned by:||dd32|
calling wp_get_current_user() when no user is logged in does not produce a User object, yet is_user_logged_in() tries to read the the id property of $user on every call to this function, whether an object exists or not.
This produces the following notice in the logs when error_reporting is set to -1
PHP Notice: Trying to get property of non-object in /Users/scott/Sites/emusic/trunk/wordpress/wp-includes/pluggable.php on line 758
The function is triggered by all calls to $WP_Query->get_posts() and will produce an obscene number of notices in error logs on high traffic sites. As an example, every XML-RPC made on eMusic.com produces this Notice in our logs.