Support » Fixing WordPress » Fatal error: Call to undefined function wp_get_current_user()

  • There are many forum posts on this topic (I stopped looking when the posts went over 100). The problem is that the pluggable functions in pluggable.php are not available until after the ‘init’ action has taken place and many plugins use these functions before that happens. The solution seems to be for the plugins to put the following line at the beginning of their plugin code:

    require_once(ABSPATH . "/wp-includes/pluggable.php");

    I am not sure if this is the best answer but I also tried wrapping all of my “pluggable” function calls with function_exists before using them and that did not work so I settled on just putting in the require_once call above and it seems to solve the problem.

  • The topic ‘Fatal error: Call to undefined function wp_get_current_user()’ is closed to new replies.