0
我想弄清楚當前用戶是否可以管理選項。我使用下面的代碼:如何檢查用戶是否具有WordPress的'manage_options'功能?
if (current_user_can('manage_options')) {
add_filter('comments_array', 'myFunctionCall');
}
但它會產生這個錯誤(在WordPress 2.9.2,最新的):
Fatal error: Call to undefined function wp_get_current_user() in /Users/******/Sites/*****.com/wp-includes/capabilities.php on line 969
我要對這個錯誤的方式?
是啊,我終於想通了,我需要調用'get_currentuserinfo()'檢查功能之前。新手錯誤!謝謝! – 2010-05-08 17:19:30