Fatal error: Call to undefined function wp_get_current_user() (3 posts)

  1. fei4msk
    Posted 2 years ago #

    Hi, guys.
    Sorry, my English is very bad.
    I have a problem.
    After installing the plugin "loginza" (login through social network), i see this error on homepage, error disappears if page refresh.
    Fatal error: Call to undefined function wp_get_current_user() in /var/www/u8116206/data/www/lwps.ru/wp-includes/capabilities.php on line 1342
    I tried to upload capabilities.php again - doesn't work.
    Wordpress - 3.8
    Help, please.

    Ой парни, надеюсь не опозорил я страну свою таким знанием английского... Стыдно.

  2. Mick Levin
    Posted 2 years ago #

    That's a problem with compatibility with one of few plugins. Try to deactivate them all, then activate one at a time, and see which one breaks the site.

    There are many ways to deactivate all plugins, my preferred one is to update the MySQL database, the table wp_options, record active_plugins. Save it's old value somewhere, and replace with this:


    Видимо есть проблема с одним или несколькими плагинами. Попробуйте деактивировать их все, и затем активировать по одному, пока сайт не сломается опять.

  3. Mick Levin
    Posted 2 years ago #


    In my case the guilty plugin calls the function "current_user_can" at improper time.

    You case could be the same - most likely, it calls current_user_can() right from the constructor, rather than from a method, which has to be called via add_action ('init', ...).

    It might be something new to WP 3.8 - at the time the plugin is being constructed, the wp-include\pluggable.php had not been called yet, and the function wp_get_current_user is not being defined yet.

    So it's up to the plugin's author to fix that.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.