Gallery Custom Links - Version 2.1.5

Version Description

(2022/10/24) = * Update: No need for jQuery anymore. * Info: If you like the plugin, your reviews are welcome here. Thank you :)

Download this release

Release Info

Developer TigrouMeow
Plugin Icon 128x128 Gallery Custom Links
Version 2.1.5
Comparing to
See all releases

Code changes from version 2.1.4 to 2.1.5

Files changed (3) hide show
  1. classes/core.php +37 -13
  2. gallery-custom-links.php +2 -2
  3. readme.txt +5 -2
classes/core.php CHANGED
@@ -214,24 +214,48 @@ class Meow_MGCL_Core
214
  ?>
215
  <script>
216
  // Used by Gallery Custom Links to handle tenacious Lightboxes
217
- jQuery(document).ready(function () {
218
 
219
  function mgclInit() {
220
- if (jQuery.fn.off) {
221
- jQuery('.no-lightbox, .no-lightbox img').off('click'); // jQuery 1.7+
 
 
 
 
 
 
 
 
 
 
 
222
  }
223
- else {
224
- jQuery('.no-lightbox, .no-lightbox img').unbind('click'); // < jQuery 1.7
225
- }
226
- jQuery('a.no-lightbox').click(mgclOnClick);
227
 
228
- if (jQuery.fn.off) {
229
- jQuery('a.set-target').off('click'); // jQuery 1.7+
 
 
 
 
 
 
230
  }
231
- else {
232
- jQuery('a.set-target').unbind('click'); // < jQuery 1.7
 
 
 
 
 
 
 
 
 
 
 
 
233
  }
234
- jQuery('a.set-target').click(mgclOnClick);
235
  }
236
 
237
  function mgclOnClick() {
@@ -259,7 +283,7 @@ class Meow_MGCL_Core
259
  mgclAddLoadEvent(mgclInit);
260
  mgclInit();
261
 
262
- });
263
  </script>
264
  <?php
265
  }
214
  ?>
215
  <script>
216
  // Used by Gallery Custom Links to handle tenacious Lightboxes
217
+ //jQuery(document).ready(function () {
218
 
219
  function mgclInit() {
220
+
221
+ // In jQuery:
222
+ // if (jQuery.fn.off) {
223
+ // jQuery('.no-lightbox, .no-lightbox img').off('click'); // jQuery 1.7+
224
+ // }
225
+ // else {
226
+ // jQuery('.no-lightbox, .no-lightbox img').unbind('click'); // < jQuery 1.7
227
+ // }
228
+
229
+ // 2022/10/24: In Vanilla JS
230
+ var elements = document.querySelectorAll('.no-lightbox, .no-lightbox img');
231
+ for (var i = 0; i < elements.length; i++) {
232
+ elements[i].onclick = null;
233
  }
 
 
 
 
234
 
235
+
236
+ // In jQuery:
237
+ //jQuery('a.no-lightbox').click(mgclOnClick);
238
+
239
+ // 2022/10/24: In Vanilla JS:
240
+ var elements = document.querySelectorAll('a.no-lightbox');
241
+ for (var i = 0; i < elements.length; i++) {
242
+ elements[i].onclick = mgclOnClick;
243
  }
244
+
245
+ // in jQuery:
246
+ // if (jQuery.fn.off) {
247
+ // jQuery('a.set-target').off('click'); // jQuery 1.7+
248
+ // }
249
+ // else {
250
+ // jQuery('a.set-target').unbind('click'); // < jQuery 1.7
251
+ // }
252
+ // jQuery('a.set-target').click(mgclOnClick);
253
+
254
+ // 2022/10/24: In Vanilla JS:
255
+ var elements = document.querySelectorAll('a.set-target');
256
+ for (var i = 0; i < elements.length; i++) {
257
+ elements[i].onclick = mgclOnClick;
258
  }
 
259
  }
260
 
261
  function mgclOnClick() {
283
  mgclAddLoadEvent(mgclInit);
284
  mgclInit();
285
 
286
+ //});
287
  </script>
288
  <?php
289
  }
gallery-custom-links.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Gallery Custom Links
4
  Plugin URI: https://meowapps.com
5
  Description: Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
6
- Version: 2.1.4
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: gallery-custom-links
@@ -15,7 +15,7 @@ http://www.gnu.org/licenses/gpl.html
15
  */
16
 
17
  if ( !defined( 'MGCL_VERSION' ) ) {
18
- define( 'MGCL_VERSION', '2.1.4' );
19
  define( 'MGCL_PREFIX', 'mgcl' );
20
  define( 'MGCL_DOMAIN', 'gallery-custom-links' );
21
  define( 'MGCL_ENTRY', __FILE__ );
3
  Plugin Name: Gallery Custom Links
4
  Plugin URI: https://meowapps.com
5
  Description: Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
6
+ Version: 2.1.5
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: gallery-custom-links
15
  */
16
 
17
  if ( !defined( 'MGCL_VERSION' ) ) {
18
+ define( 'MGCL_VERSION', '2.1.5' );
19
  define( 'MGCL_PREFIX', 'mgcl' );
20
  define( 'MGCL_DOMAIN', 'gallery-custom-links' );
21
  define( 'MGCL_ENTRY', __FILE__ );
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://meowapps.com/donation/
5
  Requires at least: 5.0
6
  Tested up to: 6.0.1
7
  Requires PHP: 7.0
8
- Stable tag: 2.1.4
9
 
10
  Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
11
 
@@ -42,9 +42,12 @@ Replace all the files. Nothing else to do.
42
 
43
  == Changelog ==
44
 
 
 
 
 
45
  = 2.1.4 (2022/10/05) =
46
  * Add: Some files were missing for the libraries autoload.
47
- * Info: If you like the plugin, your reviews are welcome [here](https://wordpress.org/support/plugin/gallery-custom-links/reviews/?rate=5#new-post). Thank you :)
48
 
49
  = 2.1.3 (2022/09/06) =
50
  * Add: Added column in the Media Library (to edit faster).
5
  Requires at least: 5.0
6
  Tested up to: 6.0.1
7
  Requires PHP: 7.0
8
+ Stable tag: 2.1.5
9
 
10
  Gallery Custom Links allows you to link images from galleries to a specified URL. Tested with WordPress Gallery, Gutenberg, the Meow Gallery and others.
11
 
42
 
43
  == Changelog ==
44
 
45
+ = 2.1.5 (2022/10/24) =
46
+ * Update: No need for jQuery anymore.
47
+ * Info: If you like the plugin, your reviews are welcome [here](https://wordpress.org/support/plugin/gallery-custom-links/reviews/?rate=5#new-post). Thank you :)
48
+
49
  = 2.1.4 (2022/10/05) =
50
  * Add: Some files were missing for the libraries autoload.
 
51
 
52
  = 2.1.3 (2022/09/06) =
53
  * Add: Added column in the Media Library (to edit faster).