FancyBox for WordPress - Version 3.2.1

Version Description

  • Update toggles
  • Added new option to make a gallery for each gutenberg gallery block
Download this release

Release Info

Developer machothemes
Plugin Icon wp plugin FancyBox for WordPress
Version 3.2.1
Comparing to
See all releases

Code changes from version 3.2.0 to 3.2.1

assets/css/fancybox-admin.css CHANGED
@@ -511,15 +511,18 @@ a.modula-link:hover {
511
 
512
  .epsilon-toggle {
513
  position: relative;
 
514
  user-select: none;
515
- display:inline-block;
516
- vertical-align: middle;
517
  }
518
 
519
  .epsilon-toggle__items {
520
  box-sizing: border-box;
521
  }
522
 
 
 
 
 
523
  .epsilon-toggle__input[type=checkbox] {
524
  border-radius: 2px;
525
  border: 2px solid #6c7781;
@@ -549,47 +552,45 @@ a.modula-link:hover {
549
 
550
  .epsilon-toggle__thumb {
551
  background-color: #6c7781;
 
552
  border-radius: 50%;
553
  display: block;
554
  height: 10px;
555
  width: 10px;
556
  position: absolute;
557
- left: 7px;
558
- top: 5px;
559
  transition: transform .2s ease;
560
  }
561
 
562
  .epsilon-toggle__off {
563
  position: absolute;
564
- right: 7px;
565
- top: 7px;
566
- width:7px;
567
- height:7px;
568
  color: #6c7781;
569
  fill: currentColor;
570
  }
571
 
572
  .epsilon-toggle__on {
573
  position: absolute;
574
- top: 7px;
575
  left: 8px;
 
576
  outline: 1px solid transparent;
577
  outline-offset: -1px;
578
  display: none;
579
- fill:#fff;
580
  }
581
 
 
582
  .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__track {
583
  background-color: #11a0d2;
584
- border: 2px solid transparent;
585
  }
586
 
587
  .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__thumb {
588
  background-color: #fff;
589
  border-width: 0;
590
  transform: translateX(18px);
591
- width: 10px;
592
- height: 10px;
593
  }
594
 
595
  .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__off {
511
 
512
  .epsilon-toggle {
513
  position: relative;
514
+ float: left;
515
  user-select: none;
 
 
516
  }
517
 
518
  .epsilon-toggle__items {
519
  box-sizing: border-box;
520
  }
521
 
522
+ .epsilon-toggle__items > * {
523
+ box-sizing: inherit;
524
+ }
525
+
526
  .epsilon-toggle__input[type=checkbox] {
527
  border-radius: 2px;
528
  border: 2px solid #6c7781;
552
 
553
  .epsilon-toggle__thumb {
554
  background-color: #6c7781;
555
+ border: 5px solid #6c7781;
556
  border-radius: 50%;
557
  display: block;
558
  height: 10px;
559
  width: 10px;
560
  position: absolute;
561
+ left: 4px;
562
+ top: 4px;
563
  transition: transform .2s ease;
564
  }
565
 
566
  .epsilon-toggle__off {
567
  position: absolute;
568
+ right: 6px;
569
+ top: 6px;
 
 
570
  color: #6c7781;
571
  fill: currentColor;
572
  }
573
 
574
  .epsilon-toggle__on {
575
  position: absolute;
576
+ top: 6px;
577
  left: 8px;
578
+ border: 1px solid #fff;
579
  outline: 1px solid transparent;
580
  outline-offset: -1px;
581
  display: none;
 
582
  }
583
 
584
+
585
  .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__track {
586
  background-color: #11a0d2;
587
+ border: 9px solid transparent;
588
  }
589
 
590
  .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__thumb {
591
  background-color: #fff;
592
  border-width: 0;
593
  transform: translateX(18px);
 
 
594
  }
595
 
596
  .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__off {
assets/js/admin.js CHANGED
@@ -100,10 +100,11 @@ jQuery(function () {
100
  case "all":
101
  case "none":
102
  case "post":
 
103
  jQuery("#customExpressionBlock").css("display", "none");
104
  }
105
 
106
- jQuery("#galleryTypeAll, #galleryTypeNone, #galleryTypePost").click(function () {
107
  jQuery("#customExpressionBlock").hide("slow");
108
  });
109
 
100
  case "all":
101
  case "none":
102
  case "post":
103
+ case "single_gutenberg_block" :
104
  jQuery("#customExpressionBlock").css("display", "none");
105
  }
106
 
107
+ jQuery("#galleryTypeAll, #galleryTypeNone, #galleryTypePost, #galleryTypeGutenbergBlock").click(function () {
108
  jQuery("#customExpressionBlock").hide("slow");
109
  });
110
 
fancybox.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: FancyBox for WordPress
4
  * Plugin URI: https://wordpress.org/plugins/fancybox-for-wordpress/
5
  * Description: Integrates <a href="http://fancyapps.com/fancybox/3/">FancyBox 3</a> into WordPress.
6
- * Version: 3.2.0
7
  * Author: Colorlib
8
  * Author URI: https://colorlib.com/wp/
9
  * Tested up to: 5.1
@@ -36,7 +36,7 @@
36
  * Plugin Init
37
  */
38
  // Constants
39
- define( 'FBFW_VERSION', '3.2.0' );
40
  define( 'FBFW_PATH', plugin_dir_path( __FILE__ ) );
41
  define( 'FBFW_URL', plugin_dir_url( __FILE__ ) );
42
  define( 'FBFW_PLUGIN_BASE', plugin_basename( __FILE__ ) );
@@ -357,7 +357,18 @@ function mfbfw_init() {
357
  });
358
 
359
  // Else, gallery type is custom, so just print the custom expression
360
- <?php } else { ?>
 
 
 
 
 
 
 
 
 
 
 
361
  /* Custom Expression */
362
  <?php echo $mfbfw['customExpression']; ?>
363
  <?php } ?>
@@ -563,3 +574,5 @@ function mfbfw_get_activate_link() {
563
  );
564
 
565
  }
 
 
3
  * Plugin Name: FancyBox for WordPress
4
  * Plugin URI: https://wordpress.org/plugins/fancybox-for-wordpress/
5
  * Description: Integrates <a href="http://fancyapps.com/fancybox/3/">FancyBox 3</a> into WordPress.
6
+ * Version: 3.2.1
7
  * Author: Colorlib
8
  * Author URI: https://colorlib.com/wp/
9
  * Tested up to: 5.1
36
  * Plugin Init
37
  */
38
  // Constants
39
+ define( 'FBFW_VERSION', '3.2.1' );
40
  define( 'FBFW_PATH', plugin_dir_path( __FILE__ ) );
41
  define( 'FBFW_URL', plugin_dir_url( __FILE__ ) );
42
  define( 'FBFW_PLUGIN_BASE', plugin_basename( __FILE__ ) );
357
  });
358
 
359
  // Else, gallery type is custom, so just print the custom expression
360
+ <?php } else if( $mfbfw['galleryType'] == 'single_gutenberg_block'){
361
+ ?>
362
+
363
+ var gallery_block = jQuery('ul.wp-block-gallery');
364
+ gallery_block.each(function() {
365
+ jQuery(this).find(thumbnails).addClass("fancyboxforwp").attr("data-fancybox","gallery"+gallery_block.index(this)).attr("rel","fancybox"+gallery_block.index(this)).getTitle();
366
+
367
+ jQuery(this).find(iframeLinks).attr({ "data-fancybox":"gallery"+gallery_block.index(this) }).attr("rel","fancybox"+gallery_block.index(this)).getTitle();
368
+
369
+ });
370
+ <?php
371
+ } else { ?>
372
  /* Custom Expression */
373
  <?php echo $mfbfw['customExpression']; ?>
374
  <?php } ?>
574
  );
575
 
576
  }
577
+
578
+ require_once 'lib/class-colorlib-dashboard-widget-extend-feed.php';
lib/admin-tab-galleries.php CHANGED
@@ -15,9 +15,9 @@ $settings['customExpression'] = str_replace('"rel"','"data-fancybox"',$settings[
15
  <?php _e( 'Make a gallery for all images on the page (default)', 'mfbfw' ); ?>
16
  </label><br /><br />
17
 
18
- <input id="galleryTypeNone" class="galleryType" type="radio" value="none" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'none' ) echo ' checked="yes"'; ?> />
19
  <label for="galleryTypeNone">
20
- <?php _e( 'Do not group images in gallery automatically (use this if you want to make galleries manually with the <code>REL</code> attribute)', 'mfbfw' ); ?>
21
  </label><br /><br />
22
 
23
  <input id="galleryTypePost" class="galleryType" type="radio" value="post" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'post' ) echo ' checked="yes"'; ?> />
15
  <?php _e( 'Make a gallery for all images on the page (default)', 'mfbfw' ); ?>
16
  </label><br /><br />
17
 
18
+ <input id="galleryTypeGutenbergBlock" class="galleryType" type="radio" value="single_gutenberg_block" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'single_gutenberg_block' ) echo ' checked="yes"'; ?> />
19
  <label for="galleryTypeNone">
20
+ <?php _e( 'Make a gallery for each gutenberg gallery block', 'mfbfw' ); ?>
21
  </label><br /><br />
22
 
23
  <input id="galleryTypePost" class="galleryType" type="radio" value="post" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'post' ) echo ' checked="yes"'; ?> />
lib/class-colorlib-dashboard-widget-extend-feed.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists( 'Colorlib_Dashboard_Widget_Extend_Feed' ) ) {
4
+
5
+ class Colorlib_Dashboard_Widget_Extend_Feed {
6
+
7
+ public function __construct() {
8
+
9
+ // Actions.
10
+ add_action( 'wp_feed_options', array( $this, 'dashboard_update_feed_urls' ), 10, 2 );
11
+
12
+ // Filters.
13
+ add_filter( 'dashboard_secondary_items', array( $this, 'dashboard_items_count' ) );
14
+
15
+ }
16
+
17
+ public function dashboard_items_count() {
18
+
19
+ /**
20
+ * Apply the filters am_dashboard_feed_count for letting an admin
21
+ * override this count.
22
+ */
23
+ return (int) apply_filters( 'colorlib_dashboard_feed_count', 6 );
24
+ }
25
+
26
+ public function dashboard_update_feed_urls( $feed, $url ) {
27
+
28
+ global $pagenow;
29
+
30
+ // Return early if not on the right page.
31
+ if ( 'admin-ajax.php' !== $pagenow ) {
32
+ return;
33
+ }
34
+
35
+ /**
36
+ * Return early if not on the right feed.
37
+ * We want to modify the feed URLs only for the
38
+ * WordPress Events & News Dashboard Widget
39
+ */
40
+ if ( is_array( $url ) ) {
41
+ if ( ! in_array( 'https://planet.wordpress.org/feed/', $url ) ) {
42
+ return;
43
+ }
44
+ }else{
45
+ if ( strpos( $url, 'planet.wordpress.org' ) === false ) {
46
+ return;
47
+ }
48
+ }
49
+
50
+ // Build the feed sources.
51
+ $all_feed_urls = $this->get_feed_urls( $url );
52
+
53
+ // Update the feed sources.
54
+ $feed->set_feed_url( $all_feed_urls );
55
+ }
56
+
57
+ public function get_feed_urls( $url ) {
58
+
59
+ // Initialize the feeds array.
60
+ $feed_urls = array( $url );
61
+
62
+ $check = get_transient( 'colorlib_dashboard_feed' );
63
+ $feeds = array();
64
+ if ( ! $check ) {
65
+
66
+ $feed_working = 'not-working';
67
+
68
+ // Load SimplePie Instance
69
+ $feed = fetch_feed( array( 'https://colorlib.com/wp/feed/' ) );
70
+
71
+ // TODO report error when is an error loading the feed
72
+ if ( ! is_wp_error( $feed ) ) {
73
+ $feed_urls[] = 'https://colorlib.com/wp/feed/';
74
+ $feed_working = 'working';
75
+ }
76
+
77
+ set_transient( 'colorlib_dashboard_feed', $feed_working, 12 * HOUR_IN_SECONDS );
78
+
79
+ }elseif ( 'working' == $check ) {
80
+ $feed_urls[] = 'https://colorlib.com/wp/feed/';
81
+ }
82
+
83
+ // Return the feed URLs.
84
+ return array_unique( $feed_urls );
85
+ }
86
+ }
87
+
88
+ // Create an instance.
89
+ new Colorlib_Dashboard_Widget_Extend_Feed();
90
+ }
license.txt CHANGED
@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
631
  state the exclusion of warranty; and each file should have at least
632
  the "copyright" line and a pointer to where the full notice is found.
633
 
634
- {one line to give the program's name and a brief idea of what it does.}
635
- Copyright (C) {year} {name of author}
636
 
637
  This program is free software: you can redistribute it and/or modify
638
  it under the terms of the GNU General Public License as published by
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
652
  If the program does terminal interaction, make it output a short
653
  notice like this when it starts in an interactive mode:
654
 
655
- {project} Copyright (C) {year} {fullname}
656
  This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
  This is free software, and you are welcome to redistribute it
658
  under certain conditions; type `show c' for details.
631
  state the exclusion of warranty; and each file should have at least
632
  the "copyright" line and a pointer to where the full notice is found.
633
 
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
 
637
  This program is free software: you can redistribute it and/or modify
638
  it under the terms of the GNU General Public License as published by
652
  If the program does terminal interaction, make it output a short
653
  notice like this when it starts in an interactive mode:
654
 
655
+ <program> Copyright (C) <year> <name of author>
656
  This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
  This is free software, and you are welcome to redistribute it
658
  under certain conditions; type `show c' for details.
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: silkalns
3
  Tags: fancybox, lightbox, jquery, gallery, image, images, photo, photos, picture, pictures, zoom
4
  Requires at least: 4.6
5
  Tested up to: 5.1
6
- Stable tag: 3.2.0
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -31,6 +31,10 @@ If you enjoy using FancyBox lightbox for WordPress please leave a [positive feed
31
 
32
  == Changelog ==
33
 
 
 
 
 
34
  = 3.2.0 =
35
  * Admin UI minor update
36
  * Removed unneeded ie css file
3
  Tags: fancybox, lightbox, jquery, gallery, image, images, photo, photos, picture, pictures, zoom
4
  Requires at least: 4.6
5
  Tested up to: 5.1
6
+ Stable tag: 3.2.1
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
31
 
32
  == Changelog ==
33
 
34
+ = 3.2.1 =
35
+ * Update toggles
36
+ * Added new option to make a gallery for each gutenberg gallery block
37
+
38
  = 3.2.0 =
39
  * Admin UI minor update
40
  * Removed unneeded ie css file