Photo Gallery by Envira – Responsive Image Gallery for WordPress - Version 1.3.3

Version Description

  • Added: Enable/disable Lightbox option
Download this release

Release Info

Developer n7studios
Plugin Icon 128x128 Photo Gallery by Envira – Responsive Image Gallery for WordPress
Version 1.3.3
Comparing to
See all releases

Code changes from version 1.3.2 to 1.3.3

envira-gallery-lite.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
6
  * Author: Thomas Griffin
7
  * Author URI: http://thomasgriffinmedia.com
8
- * Version: 1.3.2
9
  * Text Domain: envira-gallery
10
  * Domain Path: languages
11
  *
@@ -54,7 +54,7 @@ class Envira_Gallery_Lite {
54
  *
55
  * @var string
56
  */
57
- public $version = '1.3.2';
58
 
59
  /**
60
  * The name of the plugin.
5
  * Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
6
  * Author: Thomas Griffin
7
  * Author URI: http://thomasgriffinmedia.com
8
+ * Version: 1.3.3
9
  * Text Domain: envira-gallery
10
  * Domain Path: languages
11
  *
54
  *
55
  * @var string
56
  */
57
+ public $version = '1.3.3';
58
 
59
  /**
60
  * The name of the plugin.
includes/admin/metaboxes.php CHANGED
@@ -633,6 +633,15 @@ class Envira_Gallery_Metaboxes_Lite {
633
  <p class="envira-intro"><?php _e( 'The settings below adjust the lightbox outputs and displays.', 'envira-gallery' ); ?></p>
634
  <table class="form-table">
635
  <tbody>
 
 
 
 
 
 
 
 
 
636
  <tr id="envira-config-lightbox-theme-box">
637
  <th scope="row">
638
  <label for="envira-config-lightbox-theme"><?php _e( 'Gallery Lightbox Theme', 'envira-gallery' ); ?></label>
@@ -790,10 +799,15 @@ class Envira_Gallery_Metaboxes_Lite {
790
  $settings['config']['crop'] = isset( $_POST['_envira_gallery']['crop'] ) ? 1 : 0;
791
  $settings['config']['crop_width'] = absint( $_POST['_envira_gallery']['crop_width'] );
792
  $settings['config']['crop_height'] = absint( $_POST['_envira_gallery']['crop_height'] );
 
 
 
 
 
 
793
  $settings['config']['classes'] = explode( "\n", $_POST['_envira_gallery']['classes'] );
794
  $settings['config']['title'] = trim( strip_tags( $_POST['_envira_gallery']['title'] ) );
795
  $settings['config']['slug'] = sanitize_text_field( $_POST['_envira_gallery']['slug'] );
796
- $settings['config']['title_display']= preg_replace( '#[^a-z0-9-_]#', '', $_POST['_envira_gallery']['title_display'] );
797
  $settings['config']['rtl'] = isset( $_POST['_envira_gallery']['rtl'] ) ? 1 : 0;
798
 
799
  // If on an envira post type, map the title and slug of the post object to the custom fields if no value exists yet.
633
  <p class="envira-intro"><?php _e( 'The settings below adjust the lightbox outputs and displays.', 'envira-gallery' ); ?></p>
634
  <table class="form-table">
635
  <tbody>
636
+ <tr id="envira-config-lightbox-enabled-box">
637
+ <th scope="row">
638
+ <label for="envira-config-lightbox-enabled"><?php _e( 'Enable Lightbox?', 'envira-gallery' ); ?></label>
639
+ </th>
640
+ <td>
641
+ <input id="envira-config-lightbox-enabled" type="checkbox" name="_envira_gallery[lightbox_enabled]" value="<?php echo $this->get_config( 'lightbox_enabled', $this->get_config_default( 'lightbox_enabled' ) ); ?>" <?php checked( $this->get_config( 'lightbox_enabled', $this->get_config_default( 'lightbox_enabled' ) ), 1 ); ?> />
642
+ <span class="description"><?php _e( 'Enables or disables the gallery lightbox.', 'envira-gallery' ); ?></span>
643
+ </td>
644
+ </tr>
645
  <tr id="envira-config-lightbox-theme-box">
646
  <th scope="row">
647
  <label for="envira-config-lightbox-theme"><?php _e( 'Gallery Lightbox Theme', 'envira-gallery' ); ?></label>
799
  $settings['config']['crop'] = isset( $_POST['_envira_gallery']['crop'] ) ? 1 : 0;
800
  $settings['config']['crop_width'] = absint( $_POST['_envira_gallery']['crop_width'] );
801
  $settings['config']['crop_height'] = absint( $_POST['_envira_gallery']['crop_height'] );
802
+
803
+ // Lightbox
804
+ $settings['config']['lightbox_enabled'] = isset( $_POST['_envira_gallery']['lightbox_enabled'] ) ? 1 : 0;
805
+ $settings['config']['title_display'] = preg_replace( '#[^a-z0-9-_]#', '', $_POST['_envira_gallery']['title_display'] );
806
+
807
+ // Misc
808
  $settings['config']['classes'] = explode( "\n", $_POST['_envira_gallery']['classes'] );
809
  $settings['config']['title'] = trim( strip_tags( $_POST['_envira_gallery']['title'] ) );
810
  $settings['config']['slug'] = sanitize_text_field( $_POST['_envira_gallery']['slug'] );
 
811
  $settings['config']['rtl'] = isset( $_POST['_envira_gallery']['rtl'] ) ? 1 : 0;
812
 
813
  // If on an envira post type, map the title and slug of the post object to the custom fields if no value exists yet.
includes/global/common.php CHANGED
@@ -182,6 +182,7 @@ class Envira_Gallery_Common_Lite {
182
  'crop' => 0,
183
  'crop_width' => 960,
184
  'crop_height' => 300,
 
185
  'arrows' => 1,
186
  'keyboard' => 1,
187
  'mousewheel' => 1,
182
  'crop' => 0,
183
  'crop_width' => 960,
184
  'crop_height' => 300,
185
+ 'lightbox_enabled' => 1,
186
  'arrows' => 1,
187
  'keyboard' => 1,
188
  'mousewheel' => 1,
includes/global/shortcode.php CHANGED
@@ -290,49 +290,56 @@ class Envira_Gallery_Shortcode_Lite {
290
  <?php do_action( 'envira_gallery_api_isotope', $data ); // Deprecated. ?>
291
  <?php do_action( 'envira_gallery_api_enviratope', $data ); ?>
292
 
293
- $('.envira-gallery-<?php echo $data['id']; ?>').envirabox({
294
- <?php do_action( 'envira_gallery_api_config', $data ); ?>
295
- cyclic: true,
296
- centerOnScroll: true,
297
- <?php do_action( 'envira_gallery_api_config_callback', $data ); ?>
298
- onStart: function(data, index, opts){
299
- $(window).on({
300
- 'resize' : function(){
301
- $.envirabox.resize();
302
- $.envirabox.center();
 
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
- });
305
 
306
- var obj = data[index],
307
- href = opts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
308
-
309
- if ((/^(?:javascript)/i).test(href) || href == '#') {
310
- href = null;
311
- }
312
-
313
- if ( href && ! href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i) ) {
314
- window.location.href = href;
315
- return false;
316
- }
317
- },
318
- beforeLoad: function(){
319
- this.title = $(this.element).attr('title');
320
- },
321
- afterShow: function() {
322
- <?php
323
- // If title helper = float_wrap, add a CSS class so we can disable word-wrap
324
- if ( $this->get_config( 'title_display', $data ) == 'float_wrap' ) {
325
- ?>
326
- if ( ! $( 'div.envirabox-title' ).hasClass( 'envirabox-title-text-wrap' ) ) {
327
- $( 'div.envirabox-title' ).addClass( 'envirabox-title-text-wrap' );
328
  }
 
 
 
 
 
329
  <?php
 
 
 
 
 
 
 
 
 
330
  }
331
- ?>
332
- }
333
- });
 
 
334
 
335
- <?php do_action( 'envira_gallery_api_lightbox', $data ); ?>
336
  <?php do_action( 'envira_gallery_api_end', $data ); endforeach;
337
 
338
  // Minify before outputting to improve page load time.
290
  <?php do_action( 'envira_gallery_api_isotope', $data ); // Deprecated. ?>
291
  <?php do_action( 'envira_gallery_api_enviratope', $data ); ?>
292
 
293
+ <?php
294
+ // Fancybox: Start
295
+ if ( $this->get_config( 'lightbox_enabled', $data ) ) {
296
+ ?>
297
+ $('.envira-gallery-<?php echo $data['id']; ?>').envirabox({
298
+ <?php do_action( 'envira_gallery_api_config', $data ); ?>
299
+ cyclic: true,
300
+ centerOnScroll: true,
301
+ <?php do_action( 'envira_gallery_api_config_callback', $data ); ?>
302
+ onStart: function(data, index, opts){
303
+ $(window).on({
304
+ 'resize' : function(){
305
+ $.envirabox.resize();
306
+ $.envirabox.center();
307
+ }
308
+ });
309
+
310
+ var obj = data[index],
311
+ href = opts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
312
+
313
+ if ((/^(?:javascript)/i).test(href) || href == '#') {
314
+ href = null;
315
  }
 
316
 
317
+ if ( href && ! href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i) ) {
318
+ window.location.href = href;
319
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
  }
321
+ },
322
+ beforeLoad: function(){
323
+ this.title = $(this.element).attr('title');
324
+ },
325
+ afterShow: function() {
326
  <?php
327
+ // If title helper = float_wrap, add a CSS class so we can disable word-wrap
328
+ if ( $this->get_config( 'title_display', $data ) == 'float_wrap' ) {
329
+ ?>
330
+ if ( ! $( 'div.envirabox-title' ).hasClass( 'envirabox-title-text-wrap' ) ) {
331
+ $( 'div.envirabox-title' ).addClass( 'envirabox-title-text-wrap' );
332
+ }
333
+ <?php
334
+ }
335
+ ?>
336
  }
337
+ });
338
+ <?php
339
+ do_action( 'envira_gallery_api_lightbox', $data );
340
+ } // Fancybox: End
341
+ ?>
342
 
 
343
  <?php do_action( 'envira_gallery_api_end', $data ); endforeach;
344
 
345
  // Minify before outputting to improve page load time.
readme.txt CHANGED
@@ -57,6 +57,9 @@ Also, I'm an <a href="https://thomasgriffin.io" rel="me" title="WordPress Develo
57
 
58
  == Changelog ==
59
 
 
 
 
60
  = 1.3.2 =
61
  * Added: Units label to Column Gutter Width and Margin Below Each Image settings
62
 
57
 
58
  == Changelog ==
59
 
60
+ = 1.3.3 =
61
+ * Added: Enable/disable Lightbox option
62
+
63
  = 1.3.2 =
64
  * Added: Units label to Column Gutter Width and Margin Below Each Image settings
65