Title: Call to undefined function get_current_screen()
Last modified: August 21, 2016

---

# Call to undefined function get_current_screen()

 *  Resolved [ReactorShop](https://wordpress.org/support/users/reactorshop/)
 * (@reactorshop)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_current_screen-2/)
 * Hi Chouby,
 * I downloaded my production server WordPress installation, which it’s still using
   Polylang 1.1.6, into my testing environment.
 * Right after updating it with Polylang 1.2.1, and then trying to navigate to another
   page inside the WordPress administration side, I get a white page and this server
   error logged entry:
 *     ```
       PHP Fatal error:  Call to undefined function get_current_screen() in /Library/WebServer/Documents/reactorshop/wp-content/plugins/wp-e-commerce/wpsc-admin/includes/product-functions.php on line 23, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP Stack trace:, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP   1. {main}() /Library/WebServer/Documents/reactorshop/wp-admin/network/plugins.php:0, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP   2. require_once() /Library/WebServer/Documents/reactorshop/wp-admin/network/plugins.php:11, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP   3. require_once() /Library/WebServer/Documents/reactorshop/wp-admin/network/admin.php:13, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP   4. require_once() /Library/WebServer/Documents/reactorshop/wp-admin/admin.php:30, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP   5. require_once() /Library/WebServer/Documents/reactorshop/wp-load.php:29, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP   6. require_once() /Library/WebServer/Documents/reactorshop/wp-config.php:104, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP   7. do_action($tag = *uninitialized*, $arg = *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-settings.php:361, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP   8. call_user_func_array(*uninitialized*, *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/plugin.php:429, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP   9. PLL_Upgrade->wp_loaded_upgrade_1_2_1(*uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/plugin.php:429, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP  10. PLL_MO->export_to_db($lang = *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-content/plugins/polylang/include/upgrade.php:348, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP  11. wp_insert_post($postarr = *uninitialized*, $wp_error = *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-content/plugins/polylang/include/mo.php:43, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP  12. do_action($tag = *uninitialized*, $arg = *uninitialized*, *uninitialized*, *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/post.php:2954, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP  13. call_user_func_array(*uninitialized*, *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/plugin.php:429, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       PHP  14. wpsc_admin_submit_product($post_ID = *uninitialized*, $post = *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/plugin.php:429, referer: http://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
       ```
   
 * It’s not a show stopper for me, since I’m still using Polylang 1.1.6 at the server,
   and quickly reverted the upgrade modifications in my development environment,
   so I can wait.
 * Thank you, Chouby!
 * [http://wordpress.org/plugins/polylang/](http://wordpress.org/plugins/polylang/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_current_screen-2/#post-4309559)
 * This get_current_screen() function is terrific. Everybody (including me) assumes
   it is always available… when it is defined quite late. Let’s try to delay the
   update a bit later (after get_current_screen is defined).
 * Could you go in polylang/include/upgrade.php at line 329 and replace
 *     ```
       add_action('wp_loaded', array(&$this, 'wp_loaded_upgrade_1_2_1')); // once wp-rewrite is available
   
       if (did_action('wp_loaded'))
       	$this->wp_loaded_upgrade_1_2_1();
       ```
   
 * by
 *     ```
       add_action('admin_init', array(&$this, 'wp_loaded_upgrade_1_2_1')); // once wp-rewrite is available
   
       if (did_action('admin_init'))
       	$this->wp_loaded_upgrade_1_2_1();
       ```
   
 *  Thread Starter [ReactorShop](https://wordpress.org/support/users/reactorshop/)
 * (@reactorshop)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_current_screen-2/#post-4309573)
 * Yep, that solved it!
 * Thank you, Chouby!
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_current_screen-2/#post-4309581)
 * OK thanks. I’ll include it in the next release.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Call to undefined function get_current_screen()’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Chouby](https://wordpress.org/support/users/chouby/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_current_screen-2/#post-4309581)
 * Status: resolved