Support » Plugin: Media Cloud for Amazon S3, Imgix, Google Cloud Storage, DigitalOcean Spaces and more » Call to undefined function wp_get_current_user

  • Resolved marioy47

    (@marioy47)


    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

    (@interfacelab)

    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.