17 Aug 2010

Fatal error: Call to undefined function wp_get_current_user() on WordPress 3.0.x

I’ve had this error for a few days and have been unable to access my dashboard:

Call to undefined function wp_get_current_user() in /html/wp-includes/capabilities.php line 1059.

In case you run into this problem since upgrading to WP 3 try adding this code after < ?php or on line 2 of capabilities.php:

require_once(‘pluggable.php’);

It worked for me and has worked for errors appearing on other lines.

*** UPDATE: this will stop working after you do a WordPress update, so you might want to bookmark this page so you can keep reapplying the patch until they get it sorted.

Comments

  • jiay
    October 1, 2018 Reply

    Not work in my site

  • Tim
    February 26, 2011 Reply

    Sorry about the prior logged comment. What I meant to say in the opening statement was that my first line of code for the capabilities.php was:
    <?phprequire_once(‘pluggable.php’);
    What I listed in the prior posted comment was what I got when this fix was saved and the page refreshed. Sorry for my incompetence. Please forgive. Tim

    • } bird {
      February 26, 2011 Reply

      Did you get it to work?

  • Tim
    February 26, 2011 Reply

    This is what you said above to add to line 1 or 2 for the problem described. This is what line 1 looked like: “Fatal error: Call to undefined function phprequire_once() in /home/timacar/public_html/wp-includes/capabilities.php on line 1”
    The only change was the number 1059 in the first error page changed to 1 once I saved and refreshed the page. I am not a person that knows code. I still cannot access my dashboard. I can access the website as anyone else could but not as the admin. I truly hope that you can help! God Bless. Thanks, Tim

  • } bird {
    February 24, 2011 Reply

    Cheers for the comments 🙂

  • Barry White
    February 20, 2011 Reply

    It works!!! My error came after installing Freshy2 theme with customize plugin. Great theme though

    You’re fix is #1 for google on this issue, and thank goodness it is!

    Appreciate it very much. thank you for posting.

  • Luke Gedeon
    December 3, 2010 Reply

    Thanks. That worked. Seems strange WP would leave such a big hole in their code.

  • soulwarrior
    November 23, 2010 Reply

    Thank you so much, it worked for me, too! 🙂
    Was caused by the latest update of one of the plug-ins I used.

  • alreymark
    October 28, 2010 Reply

    This is great! It works for me. Thank you.

    • bird
      October 28, 2010 Reply

      Sweet! Glad to hear it 🙂 Your site’s quite the WP treasure trove. I’ve bookmarked it.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.