Title: Call to undefined function get_current_screen()
Last modified: February 14, 2023

---

# Call to undefined function get_current_screen()

 *  Resolved [Sander](https://wordpress.org/support/users/sander-falise/)
 * (@sander-falise)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_current_screen-9/)
 * Found a bug:
 * PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen()
   in …/wp-content/plugins/molongui-authorship/includes/hooks/post/query.php:6
 * Fixed it like so:
 *     ```wp-block-code
       $current_screen_id = 0;
       if ( function_exists( 'get_current_screen' ) )
       {
         $current_screen = get_current_screen();
         $current_screen_id = $current_screen->id;
       }
       ```
   
 * Then used $current_screen_id instead of $current_screen->id in the rest of the
   code.
 * Hope this helps.
 * Regards, Sander.

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

 *  Plugin Author [Molongui](https://wordpress.org/support/users/molongui/)
 * (@molongui)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_current_screen-9/#post-16471292)
 * Hi [@sander-falise](https://wordpress.org/support/users/sander-falise/) ,
 * Thanks for sharing. And sorry about that! We have released a new update (4.6.15)
   with a fix to that issue. In order to update:
    - Go to: **Dashboard > Updates > Check again**
    - When the 4.6.15 update is shown, update the plugin
    - Flush any cache you may have
    - That should be it
 * Thanks again!
 *  Thread Starter [Sander](https://wordpress.org/support/users/sander-falise/)
 * (@sander-falise)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_current_screen-9/#post-16472381)
 * Thanks for the quick fix, I can confirm it works now. The error appeared when
   logged in as admin and viewing the frontend of the website, now it’s gone. Great
   work!
 *  Plugin Author [Molongui](https://wordpress.org/support/users/molongui/)
 * (@molongui)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_current_screen-9/#post-16472702)
 * Thank you!

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/molongui-authorship/assets/icon-256x256.png?rev=2121645)
 * [Molongui Authorship – Author Boxes, Guest Authors & Co-Authors for WordPress](https://wordpress.org/plugins/molongui-authorship/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/molongui-authorship/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/molongui-authorship/)
 * [Active Topics](https://wordpress.org/support/plugin/molongui-authorship/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/molongui-authorship/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/molongui-authorship/reviews/)

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