I'm using Wordpress 3.9.1 and I get the
Fatal error: Call to undefined function get_current_screen()
if I put the following in my funcitons.php or in any file of my theme:
$screen = get_current_screen();
echo $screen;
Initially when I got the error, I was working on a theme that I'm creating. However, I tried this with few other themes including TwentyFourteen, and I still got the same error. I even deleted my Wordpress database, created a fresh one and re-installed Wordpress, but still it didn't help.
I checked the get_current_screen()
function by going to to wp-admin/includes/screen.php and it is there.
I am working on Xampp and I don't have any plugins activated as it is a fresh install. Also in my wp-config.php I haven't changed anything but the 'MySQL settings' (database, username and password) and 'DEBUG mode'.
Any suggestions on how to rectify this?