Support » Fixing WordPress » Random "Call to undefined function wp_get_current_user()" errors

  • 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • jekyll530


    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.

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Random "Call to undefined function wp_get_current_user()" errors’ is closed to new replies.