Title: Call to undefined function wp_get_current_user
Last modified: July 18, 2018

---

# Call to undefined function wp_get_current_user

 *  Resolved [marioy47](https://wordpress.org/support/users/marioy47/)
 * (@marioy47)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_current_user-4/)
 * 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 1 replies (of 1 total)

 *  Plugin Author [interfacelab](https://wordpress.org/support/users/interfacelab/)
 * (@interfacelab)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_current_user-4/#post-10835164)
 * Fixed in 2.1.6
 * The actual fix is only hijacking the upload directory naming stuff when a file
   is being uploaded.
 * WooCommerce, for some reason, calls upload_dir() before the user stuff is loaded.

Viewing 1 replies (of 1 total)

The topic ‘Call to undefined function wp_get_current_user’ is closed to new replies.

 * ![](https://ps.w.org/ilab-media-tools/assets/icon.svg?rev=2795439)
 * [Media Cloud for Bunny CDN, Amazon S3, Cloudflare R2, Google Cloud Storage, DigitalOcean and more](https://wordpress.org/plugins/ilab-media-tools/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ilab-media-tools/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ilab-media-tools/)
 * [Active Topics](https://wordpress.org/support/plugin/ilab-media-tools/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ilab-media-tools/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ilab-media-tools/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [interfacelab](https://wordpress.org/support/users/interfacelab/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_current_user-4/#post-10835164)
 * Status: resolved