I'm getting this error when wordpress does cron jobs (by visiting wp-cron.php?doing_wp_cron):
PHP Fatal error: Call to a member function get_names() on a non-object in /wp-includes/user.php on line 422
I think that the function where the error occurs (
count_users()) is being called by the wp_version_check function which is one of the regular cron actions. The error suggests that the global variable $wp_roles has not been created by the time the function is called - but I can't track where this should be happening in the first place.
I've looked at my cron options and the only ones there are the defaults (wp_update_plugins, wp_version_check, wp_update_themes, wp_scheduled_delete).
The error is occurring every single time wp-cron.php is accessed.
Any ideas what is causing this?