• I’m getting the following error:

    Fatal error: Call to undefined function wp_get_current_user() in /home/username/achurchinthehouse.com/wp-includes/capabilities.php on line 1281

    I found this article and tried their suggestion, but upon doing so was presented with this error:
    Warning: require_once(‘pluggablephp’) [function.require-once]: failed to open stream: No such file or directory in /home/username/achurchinthehouse.com/wp-includes/capabilities.php on line 1

    Fatal error: require_once() [function.require]: Failed opening required ‘‘pluggablephp’’ (include_path=’.:/usr/local/lib/php:/usr/local/php5/lib/pear’) in /home/username/achurchinthehouse.com/wp-includes/capabilities.php on line 1

    I’m not exactly experienced at any of this so a gentle and patient explanation would work best for me ??

    Also, the error actually contains my real username, for which I substituted ‘username’ in the error above. The problem is my username is my real name and I would rather not publicize my real name in a error when a website goes down. Any way to change this?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • OK, first, you don’t want to modify a core file (wp-includes/capabilities.php). As I recall, /wp-includes/pluggable.php (which defines the wp_get_current_user function) doesn’t get loaded until after plugins are loaded.

    So, it’s most likely a plugin causing the issue. Disable your plugins and see if that eliminates the error. If not, try a default WordPress theme like Twenty Thirteen (but I’m pretty sure this is a plugin issue)

    If deactivating your plugins does get rid of the error then you need to find out which plugin is causing the issue.

    Assuming it is a plugin causing the problem, the plugin author needs to add this to their code:

    <?php
    if( !function_exists( 'wp_get_current_user' ) ) {
        include( ABSPATH . "wp-includes/pluggable.php" );
    }
    ?>
    Thread Starter acerda

    (@acerda)

    Thanks Scriptrunner,

    Now for a stupid question . . . how do I disable plugins if I can’t access the site to log into the admin module? The only way I know how to do this is via the WordPress dashboard, but the site is inaccessible due to this error.

    Do you have FTP access to the site? If so, just rename the plugins directory. (wp-content/plugins)

    Thread Starter acerda

    (@acerda)

    Yes- thank you. I think I got it from here. That restored the site and gave access to the control panel. Thanks Scriptrunner.

    You’re quite welcome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal error: Call to undefined function wp_get_current_user’ is closed to new replies.