Skip to content

Commit

Permalink
Quick fix for potential fatal error on the frontend for Beaver Builde…
Browse files Browse the repository at this point in the history
…r users
  • Loading branch information
dcooney committed Mar 21, 2023
1 parent 1461985 commit ec5e449
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 7 additions & 7 deletions instant-images.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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' );

/**
Expand Down Expand Up @@ -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 <support@connekthq.com>
* @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
);
Expand Down

0 comments on commit ec5e449

Please sign in to comment.