How To Fix The “Call to undefined function: get_currentuserinfo()” Error In Wordpress

0
November 3rd, 2009

Wordpress is one of those small things that work behind the scene to provide the means for a proper development of the bigger picture. If you are using wordpress for your blog, you definitely know what I mean.

One feature that makes wordpress really great is that you can install and use almost every plug-in you can think of to make your job easier.

The problem with some plug-ins is that, under certain circumstances, they will display an annoying error on your webpage. The error will tell you that a fatal error has occurred: an undefined function (get_currentuserinfo) has been called before it is defined.

The reason for this error is that the get_currentuser() function is called by a plugin before the “pluggable.php” library is loaded. Fortunately, there is a way to fix this error even if you are not a trained programmer.

wordpress
How To Fix The “Call to undefined function: get_currentuserinfo()” Error In Wordpress

If you get this error, you should search for the get_currentuser() function in the PHP code of the file you are having problems with. When you found it, copy the following line exactly above the get_currentuser() function:

require(ABSPATH . WPINC . ‘/pluggable.php’);

This will do the trick. This way, you will be able to still enjoy the benefits of your plugins with a minimum of effort.

Leave a Reply