Easy Image Gallery - Version 1.0.3

Version Description

  • Fix: jQuery script that calls light box was being loaded when there were no gallery images
Download this release

Release Info

Developer sumobi
Plugin Icon 128x128 Easy Image Gallery
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

Files changed (3) hide show
  1. easy-image-gallery.php +1 -1
  2. includes/scripts.php +8 -3
  3. readme.txt +8 -1
easy-image-gallery.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Easy Image Gallery
4
  Plugin URI: http://sumobi.com/shop/easy-image-gallery/
5
  Description: An easy to use image gallery with drag & drop re-ordering
6
- Version: 1.0.2
7
  Author: Andrew Munro, Sumobi
8
  Author URI: http://sumobi.com
9
  License: GPL-2.0+
3
  Plugin Name: Easy Image Gallery
4
  Plugin URI: http://sumobi.com/shop/easy-image-gallery/
5
  Description: An easy to use image gallery with drag & drop re-ordering
6
+ Version: 1.0.3
7
  Author: Andrew Munro, Sumobi
8
  Author URI: http://sumobi.com
9
  License: GPL-2.0+
includes/scripts.php CHANGED
@@ -15,6 +15,7 @@ function easy_image_gallery_scripts() {
15
  if ( !isset( $post->ID ) )
16
  return;
17
 
 
18
  // JS
19
  wp_register_script( 'pretty-photo', EASY_IMAGE_GALLERY_URL . 'includes/lib/prettyphoto/jquery.prettyPhoto.js', array( 'jquery' ), EASY_IMAGE_GALLERY_VERSION, true );
20
  wp_register_script( 'fancybox', EASY_IMAGE_GALLERY_URL . 'includes/lib/fancybox/jquery.fancybox.pack.js', array( 'jquery' ), EASY_IMAGE_GALLERY_VERSION, true );
@@ -37,8 +38,10 @@ function easy_image_gallery_scripts() {
37
  if ( easy_image_gallery_is_gallery() )
38
  wp_enqueue_style( 'easy-image-gallery' );
39
 
40
- // only load the JS if there are gallery images, they are linked, and we're on a singular page
41
- if ( easy_image_gallery_has_linked_images() && easy_image_gallery_is_gallery() && is_singular() ) {
 
 
42
 
43
  $lightbox = easy_image_gallery_get_lightbox();
44
 
@@ -79,6 +82,8 @@ function easy_image_gallery_scripts() {
79
  add_action( 'wp_enqueue_scripts', 'easy_image_gallery_scripts', 20 );
80
 
81
 
 
 
82
  /**
83
  * JS
84
  *
@@ -86,7 +91,7 @@ add_action( 'wp_enqueue_scripts', 'easy_image_gallery_scripts', 20 );
86
  */
87
  function easy_image_gallery_js() {
88
 
89
- if ( ! easy_image_gallery_allowed_post_type() )
90
  return;
91
 
92
  if ( is_singular() && easy_image_gallery_has_linked_images() ) : ?>
15
  if ( !isset( $post->ID ) )
16
  return;
17
 
18
+
19
  // JS
20
  wp_register_script( 'pretty-photo', EASY_IMAGE_GALLERY_URL . 'includes/lib/prettyphoto/jquery.prettyPhoto.js', array( 'jquery' ), EASY_IMAGE_GALLERY_VERSION, true );
21
  wp_register_script( 'fancybox', EASY_IMAGE_GALLERY_URL . 'includes/lib/fancybox/jquery.fancybox.pack.js', array( 'jquery' ), EASY_IMAGE_GALLERY_VERSION, true );
38
  if ( easy_image_gallery_is_gallery() )
39
  wp_enqueue_style( 'easy-image-gallery' );
40
 
41
+ $linked_images = easy_image_gallery_has_linked_images();
42
+
43
+ // only load the JS if gallery images are linked or the featured image is linked
44
+ if ( $linked_images ) {
45
 
46
  $lightbox = easy_image_gallery_get_lightbox();
47
 
82
  add_action( 'wp_enqueue_scripts', 'easy_image_gallery_scripts', 20 );
83
 
84
 
85
+
86
+
87
  /**
88
  * JS
89
  *
91
  */
92
  function easy_image_gallery_js() {
93
 
94
+ if ( ! easy_image_gallery_allowed_post_type() || ! easy_image_gallery_is_gallery() )
95
  return;
96
 
97
  if ( is_singular() && easy_image_gallery_has_linked_images() ) : ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: image gallery, image, galleries, simple, easy, sumobi
5
  Requires at least: 3.5
6
  Tested up to: 3.6
7
- Stable tag: 1.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -99,6 +99,10 @@ If you use the template tag above, you will need remove the default content filt
99
 
100
  == Changelog ==
101
 
 
 
 
 
102
  = 1.0.2 =
103
 
104
  * Tweak: Improved loading of scripts
@@ -116,6 +120,9 @@ If you use the template tag above, you will need remove the default content filt
116
 
117
  == Upgrade Notice ==
118
 
 
 
 
119
  = 1.0.2 =
120
  Improved loading of scripts
121
 
4
  Tags: image gallery, image, galleries, simple, easy, sumobi
5
  Requires at least: 3.5
6
  Tested up to: 3.6
7
+ Stable tag: 1.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
99
 
100
  == Changelog ==
101
 
102
+ = 1.0.3 =
103
+
104
+ * Fix: jQuery script that calls light box was being loaded when there were no gallery images
105
+
106
  = 1.0.2 =
107
 
108
  * Tweak: Improved loading of scripts
120
 
121
  == Upgrade Notice ==
122
 
123
+ = 1.0.3 =
124
+ Fixes minor bug where JS was loaded onto page when there is no gallery
125
+
126
  = 1.0.2 =
127
  Improved loading of scripts
128