How do I check if a user has the manage_options capability in WordPress?
-
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?
- The topic ‘How do I check if a user has the manage_options capability in WordPress?’ is closed to new replies.