Title: New update crash website
Last modified: February 28, 2025

---

# New update crash website

 *  Resolved [vascogomes](https://wordpress.org/support/users/vascogomes/)
 * (@vascogomes)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/new-update-crash-website/)
 * WordPress version 6.7.2
   Active theme: Newspaperup (version 1.1.7)Current plugin:
   EXMAGE – WordPress Image Links (version 1.0.22)PHP version 7.4.33 Error Details
 * An error of type E_ERROR was caused in line 94 of the file /home/public/wp-content/
   plugins/exmage-wp-image-links/exmage-wp-image-links.php. Error message: Uncaught
   Error: Call to undefined function get_current_screen() in /home/public/wp-content/
   plugins/exmage-wp-image-links/exmage-wp-image-links.php:94
   Stack trace: 0 /home/
   public/wp-includes/class-wp-hook.php(324): EXMAGE_WP_IMAGE_LINKS->filter_exmage_in_library_page()
   1 /home/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 2/
   home/public/wp-includes/plugin.php(565): WP_Hook->do_action() 3 /home/public/
   wp-includes/class-wp-query.php(1881): do_action_ref_array() 4 /home/public/wp-
   includes/class-wp-query.php(3852): WP_Query->get_posts() 5 /home/public/wp-includes/
   post.php(2541): WP_Query->query() 6 /home/public/wp-content/plugins/jetpack/modules/
   memberships/class-jetpack-memberships.php(877): get_posts() 7 /home/public/wp-
   content/plugins/jetpack/extension

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

 *  [Kerk en IT](https://wordpress.org/support/users/kerkenit/)
 * (@kerkenit)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/new-update-crash-website/#post-18336297)
 * I editen this file `wp-content/plugins/exmage-wp-image-links/exmage-wp-image-
   links.php`
 * I replaced line 94 with ` $screen = false;//get_current_screen();` because `get_current_screen()`
   is missing. The site works again
    -  This reply was modified 1 year, 1 month ago by [Kerk en IT](https://wordpress.org/support/users/kerkenit/).
      Reason: Wrong line number
 *  [samysalahgad](https://wordpress.org/support/users/samysalahgad/)
 * (@samysalahgad)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/new-update-crash-website/#post-18336992)
 * public function filter_exmage_in_library_page( $query ) {
   if (!is_admin() || !
   function_exists(‘get_current_screen’)) {return;}
 *     ```wp-block-code
       $screen = get_current_screen();
       if ($screen && $screen->base === 'upload') {
           if (isset($_REQUEST['exmage_filter'])) {
               $exmage_filter = sanitize_text_field($_REQUEST['exmage_filter']);
               $meta_query = [];
   
               switch ($exmage_filter) {
                   case 'only_downloaded':
                       $meta_query = [
                           'relation' => 'AND',
                           [
                               'key'     => '_exmage_external_url',
                               'compare' => 'EXISTS',
                           ],
                           [
                               'key'     => '_exmage_imported',
                               'compare' => 'EXISTS',
                           ]
                       ];
                       break;
                   case 'only_undownloaded':
                       $meta_query = [
                           'relation' => 'AND',
                           [
                               'key'     => '_exmage_external_url',
                               'compare' => 'EXISTS',
                           ],
                           [
                               'key'     => '_exmage_imported',
                               'compare' => 'NOT EXISTS',
                           ]
                       ];
                       break;
                   default:
                       $meta_query = [
                           'relation' => 'OR',
                           [
                               'key'     => '_exmage_external_url',
                               'compare' => 'EXISTS',
                           ],
                           [
                               'key'     => '_exmage_imported',
                               'compare' => 'EXISTS',
                           ]
                       ];
                       break;
               }
   
               $query->set('meta_query', $meta_query);
           }
       }
       ```
   
 * }
 *  Thread Starter [vascogomes](https://wordpress.org/support/users/vascogomes/)
 * (@vascogomes)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/new-update-crash-website/#post-18337232)
 * [@samysalahgad](https://wordpress.org/support/users/samysalahgad/) what is that?
 *  [bhioux](https://wordpress.org/support/users/bhioux/)
 * (@bhioux)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/new-update-crash-website/#post-18337782)
 * The recent update actually crashed websites.
   so the issue is with the way the
   get_current_screen() is called.
 * get_current_screen() is only available to admin session.
 *     ```wp-block-code
       $screen = get_current_screen();if (is_admin() && $screen && $screen->base === 'upload') {
       ```
   
 * The above is the way the recent update did the implementation – called get_current_screen()
   before checking is_admin().
   I made the adjustment below (doing the is_admin()
   check before calling the get_current_screen()).
 *     ```wp-block-code
       if(is_admin()){    $screen = get_current_screen();    if($screen && $screen->base === 'upload') {    ....    }}
       ```
   
 *  [angelagrey](https://wordpress.org/support/users/angelagrey/)
 * (@angelagrey)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/new-update-crash-website/#post-18337899)
 * Hi guys,
 * Thank you for reaching out to us.
 * We just updated this plugin addressing the error. Can you please pull the latest
   version and try again?
 * Best regards.

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

The topic ‘New update crash website’ is closed to new replies.

 * ![](https://ps.w.org/exmage-wp-image-links/assets/icon-256x256.gif?rev=3081768)
 * [EXMAGE - WordPress Image Links](https://wordpress.org/plugins/exmage-wp-image-links/)
 * [Support Threads](https://wordpress.org/support/plugin/exmage-wp-image-links/)
 * [Active Topics](https://wordpress.org/support/plugin/exmage-wp-image-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/exmage-wp-image-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/exmage-wp-image-links/reviews/)

 * 5 replies
 * 10 participants
 * Last reply from: [angelagrey](https://wordpress.org/support/users/angelagrey/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/new-update-crash-website/#post-18337899)
 * Status: resolved