Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Call to undefined function wp_get_current_user

$
0
0

Replies: 0

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.


Viewing all articles
Browse latest Browse all 59525

Trending Articles