Another observation:
that row of code is inside class constructor. If I call new instance of class inside main plugin file, it ends with error. But when I call constructor from theme, it works. It seems that wordpress functions are not “included” when plugin code is executed, but when theme code is executed, they are. Can this be true?
(i have upgraded wordpess to 3.2.1 meanwhile, code still doesn’t work)
Unfortunately this didn’t help. I’m getting another error:
Fatal error: Call to undefined function wp_get_current_user() in D:\www\adspace\wp-includes\capabilities.php on line 1039
When I put this line
if (current_user_can('edit_pages') ) echo "Hi Admin!";
into a function and then call it from theme, it works, But i need to run this code in constructor of a class – and there it does not work.
To make it simple: i cannot call any wordpress function in my plugin:-(