Title: Version 5.2.0 error
Last modified: March 20, 2023

---

# Version 5.2.0 error

 *  Resolved [ezweb](https://wordpress.org/support/users/ezweb/)
 * (@ezweb)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/)
 * Uncaught Error: Call to undefined function get_current_screen()
   wp-content/plugins/
   instant-images/instant-images.php:180

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/version-5-2-0-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/version-5-2-0-error/page/2/?output_format=md)

 *  Thread Starter [ezweb](https://wordpress.org/support/users/ezweb/)
 * (@ezweb)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16578504)
 * This causes a fatal error on the frontend. I added an is_admin check to fix it.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16578575)
 * Thanks [@ezweb](https://wordpress.org/support/users/ezweb/) . Can you share the
   code?
 *     ```wp-block-code
       $screen = is_admin() ? get_current_screen()->base : '';
       ```
   
 * Are you getting this error in a frontend page builder?
    -  This reply was modified 3 years, 2 months ago by [Darren Cooney](https://wordpress.org/support/users/dcooney/).
 *  Thread Starter [ezweb](https://wordpress.org/support/users/ezweb/)
 * (@ezweb)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16578596)
 * I use beaver builder so maybe that’s part of it not sure. But that’s not when
   trying to edit the site. It’s just viewing a page on the front end. It completely
   breaks the site.
 * I just wrapped everything in the instant_img_wp_media_enqueue function in a “
   if ( is_admin() ) {” so none of it runs if it’s not in the admin area. Not sure
   that’s the correct fix. But the site works.
 *  Thread Starter [ezweb](https://wordpress.org/support/users/ezweb/)
 * (@ezweb)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16578612)
 * It could be caused by front end ACF forms. We use them on all sites. And I’ve
   got a bit of a mess. I’m updating all sites with my “fix” now.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16578656)
 * Yea maybe, just releasing a hotfix now (5.2.0.1).
 * In my testing it would only fatal error if the user was logged in. Still not 
   great, but some positive news.
 *  Thread Starter [ezweb](https://wordpress.org/support/users/ezweb/)
 * (@ezweb)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16581955)
 * New version seems great. Thank you!
 *  [yabwee](https://wordpress.org/support/users/yabwee/)
 * (@yabwee)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16599320)
 * I’m getting this exact error still. It’s occurring on the Elementor front-end
   page-builder – more specifically, the Theme Builder page
 * ![](https://i0.wp.com/test.churchinfinite.com/wp-content/mu-plugins/church-infinite/
   images/Screen%20Shot%202023-03-27%20at%2012.08.02%20PM.png?ssl=1)
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16599360)
 * I can’t replicate the error in Elementor running Instant Images 5.2.0.1 and Elementor
   Pro 3.11.7
 *  [dcnz](https://wordpress.org/support/users/dcnz/)
 * (@dcnz)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16600124)
 * I get the same error with Elementor too. Hopefully this helps:
 *     ```wp-block-code
       Error Details
       =============
       An error of type E_ERROR was caused in line 180 of the file /container/application/public/wp-content/plugins/instant-images/instant-images.php. Error message: Uncaught Error: Call to undefined function get_current_screen() in /container/application/public/wp-content/plugins/instant-images/instant-images.php:180
       Stack trace:
       #0 /container/application/public/wp-includes/class-wp-hook.php(308): InstantImages->instant_img_wp_media_enqueue('')
       #1 /container/application/public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
       #2 /container/application/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
       #3 /container/application/public/wp-includes/media.php(4747): do_action('wp_enqueue_medi...')
       #4 /container/application/public/wp-content/plugins/elementor/app/modules/onboarding/module.php(460): wp_enqueue_media()
       #5 /container/application/public/wp-includes/class-wp-hook.php(308): Elementor\App\Modules\Onboarding\Module->Elementor\App\Modules\Onboarding\{closure}('')
       #6 /container/application/public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
       #7 /container/application/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
       #8 /container/application/public/wp-content/plugins/elementor/includes/plugin.php(652): do_action('elementor/init')
       #9 /container/application/public/wp-includes/class-wp-hook.php(308): Elementor\Plugin->init('')
       #10 /container/application/public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
       #11 /container/application/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
       #12 /container/application/public/wp-settings.php(617): do_action('init')
       #13 /container/application/public/wp-config.php(97): require_once('/container/appl...')
       #14 /container/application/public/wp-load.php(50): require_once('/container/appl...')
       #15 /container/application/public/wp-admin/admin.php(34): require_once('/container/appl...')
       #16 {main}
         thrown
       ```
   
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16600142)
 * What versions of Instant Images, Elementor, and Elementor Pro.
    - Is this on a standard front-end editor screen when using the Image module (
      [screenshot](https://capture.dropbox.com/qlm30Q2sBz1qTU7M))?
    - Are there fatal errors on frontend or is this in the debug logs?
 *  [dcnz](https://wordpress.org/support/users/dcnz/)
 * (@dcnz)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16600158)
 * Instant Images 5.2.0.1, Elementor 3.11.5 and Elementor Pro 3.11.7.
 * PHP version 8.0.28 if that helps.
 * Is this on a standard front-end editor screen when using the Image module? – 
   I wasn’t accessing Instant Images as per your screenshot. I edited some text 
   on the page in Elementor, updated the page, and then received the Your Site is
   Experiencing a Technical Issue email.
 * Are there fatal errors on frontend or is this in the debug logs? – For this particular
   site I didn’t have a visual fatal error and could still edit the page. But on
   another site I’ve had it where I had the white screen of death on the front end.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16600492)
 * I’m running the exact same setup with no errors, visual or in debug.log.
 * Favor – Can you please outline the exact steps to reproducing the issue?
 * e.g. Pages > Add New > Save > Edit with Elementor. Etc.
 *  [dcnz](https://wordpress.org/support/users/dcnz/)
 * (@dcnz)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16600642)
 * Ok I just set up a test site to try replicate it myself.
 * I’ve worked out that if I edit the page in Elementor via the back end it wouldn’t
   trigger a fatal error.
 * But if I view the page normally on the front end and then click Edit with Elementor
   from the admin bar at the top, I will get the ‘Your Site is Experiencing a Technical
   Issue’ email. And that’s without editing anything on the page and only opening
   it in Elementor.
 * But it doesn’t seem to do it every time. Only if it’s the first time editing 
   a page via the front end after updating the Instant Images plugin. I’ve tried
   editing other pages after the fact, but it doesn’t trigger the fatal error.
 * I tried the same method on another website that’s running Elementor 3.10.2 / 
   Elementor Pro 3.10.3 and updated the Instant Images plugin to the latest version.
   Then edited a page in Elementor via the front end and it triggered the same fatal
   error. After that, I tried editing other pages and didn’t get the fatal error.
 * But it doesn’t stop me from editing that page or others or even viewing the website
   normally.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/#post-16602152)
 * Just released **5.2.0.2** hotfix. 
   Hopefully that solves this issue. 🤞
 *  [dcnz](https://wordpress.org/support/users/dcnz/)
 * (@dcnz)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/page/2/#post-16603941)
 * So far so good 👍

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/version-5-2-0-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/version-5-2-0-error/page/2/?output_format=md)

The topic ‘Version 5.2.0 error’ is closed to new replies.

 * ![](https://ps.w.org/instant-images/assets/icon-256x256.png?rev=2504172)
 * [Instant Images - One-click Image Uploads from Unsplash, Openverse, Pixabay, Pexels, and Giphy](https://wordpress.org/plugins/instant-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/instant-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/instant-images/)
 * [Active Topics](https://wordpress.org/support/plugin/instant-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/instant-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/instant-images/reviews/)

 * 17 replies
 * 4 participants
 * Last reply from: [yabwee](https://wordpress.org/support/users/yabwee/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/version-5-2-0-error/page/2/#post-16604244)
 * Status: resolved