When I use current_user_can() in the __construct function in my plugin I'll get this error: Fatal error: Call to undefined function wp_get_current_user() in C:\Inetpub\WP\wp-includes\capabilities.php on line 969
class myPlugin {
public function __construct() {
if(current_user_can('manage_options'))
add_action("publish_post",array(&$this,'save_post_form'));
}
}
Is it not possible to run the current_user_can() in the __construct-funktion?