diff --git a/README.txt b/README.txt index 8118498..c935e08 100755 --- a/README.txt +++ b/README.txt @@ -145,6 +145,9 @@ How to install Instant Images. == Changelog == += 5.2.0.1 - March 20, 2023 = +* HOTFIX: Quick fix for potential fatal error on the frontend for Beaver Builder users. Fixed by wrapping function check in `is_admin()`. + = 5.2.0 - March 20, 2023 = * NEW: Added new setting to automatically add image attribution as captions. * NEW: Adding mime type checking based on current allowed uploads. diff --git a/instant-images.php b/instant-images.php index 28a0687..9736223 100755 --- a/instant-images.php +++ b/instant-images.php @@ -7,7 +7,7 @@ * Twitter: @connekthq * Author URI: https://connekthq.com * Text Domain: instant-images - * Version: 5.2.0 + * Version: 5.2.0.1 * License: GPL * Copyright: Darren Cooney & Connekt Media * @@ -18,7 +18,7 @@ exit; } -define( 'INSTANT_IMAGES_VERSION', '5.2.0' ); +define( 'INSTANT_IMAGES_VERSION', '5.2.0.1' ); define( 'INSTANT_IMAGES_RELEASE', 'March 20, 2023' ); /** @@ -170,19 +170,19 @@ public function instant_img_block_plugin_enqueue() { } /** - * Enqueue script for Media Modal and Blocks sidebar + * Enqueue script for Media Modal and Blocks sidebar. * * @author ConnektMedia * @since 4.0 */ public function instant_img_wp_media_enqueue() { - $show_tab = $this::instant_img_show_tab( 'media_modal_display' ); // Show Tab Setting. - $screen = get_current_screen()->base; - if ( $this::instant_img_has_access() && $show_tab && $screen !== 'upload' ) { + $show_tab = $this::instant_img_show_tab( 'media_modal_display' ); // Show Tab Setting. + $current_screen = is_admin() ? get_current_screen()->base : ''; // Current admin screen. + if ( $this::instant_img_has_access() && $show_tab && $current_screen !== 'upload' ) { wp_enqueue_script( 'instant-images-media-modal', INSTANT_IMAGES_URL . 'build/media-modal.js', - [], + [ 'wp-element' ], INSTANT_IMAGES_VERSION, true );