You may be seeing the following error on your WordPress site:
Fatal error: Call to undefined function wp_get_current_user()
It’s being caused by the
wp_get_current_user() being called too early. You first have to wait for
If for example you were trying to do something like:
…in a plugin, WordPress may throw back the above error.
To fix it, wrap it in a function and then add it to the
plugins_loaded action, like so:
Any questions, let me know!