+1  A: 

Hi Thinkswan,

I checked your code and works fine in my site (using WP 2.9.2 too).

Check that the function is defined in the pluggable.php file inside /wp-includes.

In my WP installation I've got the function defined from line 69 to 76:

if ( !function_exists('wp_get_current_user') ) :
/**
 * Retrieve the current user object.
 *
 * @since 2.0.3
 *
 * @return WP_User Current user WP_User object
 */
function wp_get_current_user() {
    global $current_user;

    get_currentuserinfo();

    return $current_user;
}
endif;
XaviEsteve
Yeah, I finally figured out that I need to call `get_currentuserinfo()` before checking for capabilities. Novice mistake! Thanks!
thinkswan