Random "Call to undefined function wp_get_current_user()" errors (3 posts)

  1. Steve
    Posted 5 years ago #

    Sometimes my plugin causes the following error to be thrown, usually on activation but I've had it occur at other times:

    Fatal error: Call to undefined function wp_get_current_user() in /path to wordpress install/wp-includes/capabilities.php on line 1059

    There seems to be no logic behind it happening.

    All I can assume is that one of my "current_user_can" checks is firing when it shouldn't do but of course its very hard to find out which one.

    The "fix" seems to be to add require_once('pluggable.php'); to the top of the capabilities.php file But I really shouldn't have to ask users to do that.

  2. jekyll530
    Posted 5 years ago #

    I got exactly the same problem after I changed my original WP install into a blog-network (formerly WordPress MU).

    I found that it's because of some pluggins, when I disable them (actually I only disabled one), then everything works fine.

  3. RavanH
    Posted 4 years ago #

    Please check if the plugins that seem to be involved have files named settings.php or options.php included... If so, try renaming them (and adapt their include statement accordingly to keep plugin functionality) and try again with the plugin(s) activated.

Topic Closed

This topic has been closed to new replies.

About this Topic