I’m trying to write my first wordpress plugin.
Here is my code:
<?php /* Plugin Name: Hello-World Plugin URI: http://yourdomain.com/ Description: A simple hello world wordpress plugin Version: 1.0 Author: martin Author URI: http://yourdomain.com License: GPL */ if (current_user_can('edit_pages') ) echo "Hi Admin!"; ?>
And here is the result:
Fatal error: Call to undefined function wp_get_current_user() in D:\www\adspace\wp-includes\capabilities.php on line 1028
Similar situation appears when calling any wordpress function or trying to use global variable (eg. global $current_user). I simply have no access to WP functions. Can you tell me why, please?
Thanks for any advice,
- The topic ‘No access to wordpress functions in plugin’ is closed to new replies.