Call to undefined function wp_get_current_user
-
When I add a prefix on the *Storage Settings*, I’m getting the following error on the PHP logs:
`
2018/07/18 16:55:04 [error] 1564#1564: *116491 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to undefined function wp_get_current_user() in /var/www/wp/wp-content/plugins/ilab-media-tools/classes/Utilities/Prefixer.php:124
`
I fixed adding the following code on the
parsePrefix()
function:`
if(!function_exists(‘wp_get_current_user’)) {
include(ABSPATH . “wp-includes/pluggable.php”);
}
`
The best option would be to make sure the
parsePrefix()
function is fired later on the wordpress execution stack.
- The topic ‘Call to undefined function wp_get_current_user’ is closed to new replies.