I’m trying to figure out if the current user can manage options. I’m using the following code:
if (current_user_can('manage_options')) {
add_filter('comments_array', 'myFunctionCall');
}
But it produces this error (in WordPress 2.9.2, latest):
Fatal error: Call to undefined
function wp_get_current_user() in
/Users/******/Sites/*****.com/wp-includes/capabilities.php on line 969
Am I going about this the wrong way?
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: