Version Description
- Fixed "All links get the fancybox class"
Download this release
Release Info
Developer | colorlibplugins |
Plugin | FancyBox for WordPress |
Version | 3.1.2 |
Comparing to | |
See all releases |
Code changes from version 3.1.1 to 3.1.2
- fancybox.php +59 -78
- readme.txt +4 -1
fancybox.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: FancyBox for WordPress
|
5 |
Plugin URI: https://wordpress.org/plugins/fancybox-for-wordpress/
|
6 |
Description: Integrates <a href="http://fancyapps.com/fancybox/3/">FancyBox 3</a> into WordPress.
|
7 |
-
Version: 3.1.
|
8 |
Author: Colorlib
|
9 |
Author URI: https://colorlib.com/wp/
|
10 |
|
@@ -19,7 +19,7 @@ Author URI: https://colorlib.com/wp/
|
|
19 |
* Plugin Init
|
20 |
*/
|
21 |
// Constants
|
22 |
-
define( 'FBFW_VERSION', '3.1.
|
23 |
define( 'FBFW_PATH', plugin_dir_path( __FILE__ ) );
|
24 |
define( 'FBFW_URL', plugin_dir_url( __FILE__ ) );
|
25 |
define( 'FBFW_PLUGIN_BASE', plugin_basename( __FILE__ ) );
|
@@ -106,7 +106,7 @@ function mfbfw_defaults() {
|
|
106 |
jQuery.each(arr, function() {
|
107 |
var title = jQuery(this).children("img").attr("title");
|
108 |
var caption = jQuery(this).next("figcaption").html();
|
109 |
-
if(caption.length){jQuery(this).attr("title",title+" " + caption)}else{ jQuery(this).attr("title",title);}
|
110 |
}); ',
|
111 |
'nojQuery' => '',
|
112 |
'extraCallsEnable' => '',
|
@@ -266,111 +266,92 @@ function mfbfw_init() {
|
|
266 |
' . ( isset( $mfbfw['titleColor'] ) && $mfbfw['titlePosition'] == 'inside' ? 'div.fancybox-caption p.caption-title{color:' . $mfbfw['titleColor'] . '}' : 'div.fancybox-caption p.caption-title{color:#fff}' ) . '
|
267 |
' . ( isset( $mfbfw['titlePosition'] ) ? 'div.fancybox-caption {color:' . $mfbfw['titleColor'] . '}' : 'div.fancybox-caption p.caption-title{color:#333333}' ) . $captionPosition . '
|
268 |
</style>';
|
269 |
-
|
270 |
-
echo '
|
271 |
<script type="text/javascript">
|
272 |
jQuery(function(){
|
273 |
|
274 |
jQuery.fn.getTitle = function() { // Copy the title of every IMG tag and add it to its parent A so that fancybox can show titles
|
275 |
-
|
276 |
}
|
277 |
|
278 |
// Supported file extensions
|
279 |
-
var thumbnails = jQuery("a:has(img)").not(".nolightbox
|
280 |
-
if ( $mfbfw['galleryType'] == 'post' ) {
|
281 |
|
282 |
// Gallery type BY POST and on post or page (so only one post or page is visible)
|
283 |
-
if ( is_singular() ) {
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
jQuery(this).find(thumbnails).addClass("fancybox").attr("data-fancybox","gallery"+posts.index(this)).attr("rel","fancybox"+posts.index(this)).getTitle()
|
296 |
-
});
|
297 |
-
';
|
298 |
-
}
|
299 |
|
300 |
// Gallery type ALL
|
301 |
-
} elseif ( $mfbfw['galleryType'] == 'all' ) {
|
302 |
-
echo '
|
303 |
// Gallery All
|
304 |
thumbnails.addClass("fancybox").attr("data-fancybox","gallery").getTitle();
|
305 |
-
';
|
306 |
|
307 |
// Gallery type NONE
|
308 |
-
} elseif ( $mfbfw['galleryType'] == 'none' ) {
|
309 |
-
echo '
|
310 |
// No Galleries
|
311 |
thumbnails.each(function(){
|
312 |
var rel = jQuery(this).attr("rel");
|
313 |
var imgTitle = jQuery(this).children("img").attr("title");
|
314 |
jQuery(this).addClass("fancybox").attr("data-fancybox",rel);
|
315 |
jQuery(this).attr("title",imgTitle);
|
316 |
-
})
|
317 |
-
';
|
318 |
|
319 |
// Else, gallery type is custom, so just print the custom expression
|
320 |
-
} else {
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
';
|
325 |
-
}
|
326 |
|
327 |
-
// Call fancybox and apply it on any link with a rel atribute that starts with "fancybox", with the options set on the admin panel
|
328 |
-
echo '
|
329 |
jQuery("a.fancybox").fancybox({
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
'
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
"caption" : ' . $caption . ',
|
358 |
-
"afterLoad" : ' . $afterLoad . ',
|
359 |
});
|
360 |
-
'
|
|
|
|
|
|
|
361 |
|
362 |
-
if ( isset( $mfbfw['extraCallsEnable'] ) && $mfbfw['extraCallsEnable'] ) {
|
363 |
-
echo '
|
364 |
-
// Extra Calls
|
365 |
-
' . $mfbfw['extraCallsData'] . '
|
366 |
-
';
|
367 |
-
}
|
368 |
-
|
369 |
-
echo '
|
370 |
})
|
371 |
</script>
|
372 |
<!-- END Fancybox for WordPress -->
|
373 |
-
|
374 |
}
|
375 |
}
|
376 |
|
4 |
Plugin Name: FancyBox for WordPress
|
5 |
Plugin URI: https://wordpress.org/plugins/fancybox-for-wordpress/
|
6 |
Description: Integrates <a href="http://fancyapps.com/fancybox/3/">FancyBox 3</a> into WordPress.
|
7 |
+
Version: 3.1.2
|
8 |
Author: Colorlib
|
9 |
Author URI: https://colorlib.com/wp/
|
10 |
|
19 |
* Plugin Init
|
20 |
*/
|
21 |
// Constants
|
22 |
+
define( 'FBFW_VERSION', '3.1.2' );
|
23 |
define( 'FBFW_PATH', plugin_dir_path( __FILE__ ) );
|
24 |
define( 'FBFW_URL', plugin_dir_url( __FILE__ ) );
|
25 |
define( 'FBFW_PLUGIN_BASE', plugin_basename( __FILE__ ) );
|
106 |
jQuery.each(arr, function() {
|
107 |
var title = jQuery(this).children("img").attr("title");
|
108 |
var caption = jQuery(this).next("figcaption").html();
|
109 |
+
if(caption.length){jQuery(this).attr("title",title+" " + caption)}else{ jQuery(this).attr("title",title);};
|
110 |
}); ',
|
111 |
'nojQuery' => '',
|
112 |
'extraCallsEnable' => '',
|
266 |
' . ( isset( $mfbfw['titleColor'] ) && $mfbfw['titlePosition'] == 'inside' ? 'div.fancybox-caption p.caption-title{color:' . $mfbfw['titleColor'] . '}' : 'div.fancybox-caption p.caption-title{color:#fff}' ) . '
|
267 |
' . ( isset( $mfbfw['titlePosition'] ) ? 'div.fancybox-caption {color:' . $mfbfw['titleColor'] . '}' : 'div.fancybox-caption p.caption-title{color:#333333}' ) . $captionPosition . '
|
268 |
</style>';
|
269 |
+
?>
|
|
|
270 |
<script type="text/javascript">
|
271 |
jQuery(function(){
|
272 |
|
273 |
jQuery.fn.getTitle = function() { // Copy the title of every IMG tag and add it to its parent A so that fancybox can show titles
|
274 |
+
<?php echo $mfbfw['copyTitleFunction'] ?>
|
275 |
}
|
276 |
|
277 |
// Supported file extensions
|
278 |
+
var thumbnails = jQuery("a:has(img)").not(".nolightbox").filter( function() { return /\.(jpe?g|png|gif|bmp)$/i.test(jQuery(this).attr('href')) });
|
279 |
+
<?php if ( $mfbfw['galleryType'] == 'post' ) { ?>
|
280 |
|
281 |
// Gallery type BY POST and on post or page (so only one post or page is visible)
|
282 |
+
<?php if ( is_singular() ) { ?>
|
283 |
+
// Gallery by post
|
284 |
+
thumbnails.addClass("fancybox").attr("data-fancybox","gallery").getTitle();
|
285 |
+
|
286 |
+
<?php } else { ?>
|
287 |
+
// Gallery by post
|
288 |
+
var posts = jQuery(".post");
|
289 |
+
posts.each(function() {
|
290 |
+
jQuery(this).find(thumbnails).addClass("fancybox").attr("data-fancybox","gallery"+posts.index(this)).attr("rel","fancybox"+posts.index(this)).getTitle()
|
291 |
+
});
|
292 |
+
|
293 |
+
<?php } ?>
|
|
|
|
|
|
|
|
|
294 |
|
295 |
// Gallery type ALL
|
296 |
+
<?php } elseif ( $mfbfw['galleryType'] == 'all' ) { ?>
|
|
|
297 |
// Gallery All
|
298 |
thumbnails.addClass("fancybox").attr("data-fancybox","gallery").getTitle();
|
|
|
299 |
|
300 |
// Gallery type NONE
|
301 |
+
<?php } elseif ( $mfbfw['galleryType'] == 'none' ) { ?>
|
|
|
302 |
// No Galleries
|
303 |
thumbnails.each(function(){
|
304 |
var rel = jQuery(this).attr("rel");
|
305 |
var imgTitle = jQuery(this).children("img").attr("title");
|
306 |
jQuery(this).addClass("fancybox").attr("data-fancybox",rel);
|
307 |
jQuery(this).attr("title",imgTitle);
|
308 |
+
});
|
|
|
309 |
|
310 |
// Else, gallery type is custom, so just print the custom expression
|
311 |
+
<?php } else { ?>
|
312 |
+
/* Custom Expression */
|
313 |
+
<?php echo $mfbfw['customExpression']; ?>
|
314 |
+
<?php } ?>
|
|
|
|
|
315 |
|
316 |
+
// Call fancybox and apply it on any link with a rel atribute that starts with "fancybox", with the options set on the admin panel
|
|
|
317 |
jQuery("a.fancybox").fancybox({
|
318 |
+
loop: <?php echo ( isset( $mfbfw['cyclic'] ) && $mfbfw['cyclic'] ? 'true' : 'false' ) ?>,
|
319 |
+
smallBtn: <?php echo ( isset( $mfbfw['showCloseButton'] ) && $mfbfw['showCloseButton'] ? 'true' : 'false' ) ?>,
|
320 |
+
zoomOpacity: <?php echo ( isset( $mfbfw['zoomOpacity'] ) && $mfbfw['zoomOpacity'] ? '"auto"' : 'false' ) ?>,
|
321 |
+
animationEffect: "<?php echo $mfbfw['transitionIn'] ?>",
|
322 |
+
animationDuration: <?php echo $mfbfw['zoomSpeedIn'] ?>,
|
323 |
+
transitionEffect: "<?php echo $mfbfw['transitionEffect'] ?>",
|
324 |
+
transitionDuration : "<?php echo $mfbfw['zoomSpeedChange'] ?>",
|
325 |
+
overlayShow: <?php echo ( isset( $mfbfw['overlayShow'] ) && $mfbfw['overlayShow'] ? 'true' : 'false' ) ?>,
|
326 |
+
overlayOpacity: "<?php echo $mfbfw['overlayOpacity'] ?>",
|
327 |
+
titleShow: <?php echo ( isset( $mfbfw['titleShow'] ) && $mfbfw['titleShow'] ? 'true' : 'false' ) ?>,
|
328 |
+
titlePosition: "<?php echo $mfbfw['titlePosition'] ?>",
|
329 |
+
keyboard: <?php echo ( isset( $mfbfw['enableEscapeButton'] ) && $mfbfw['enableEscapeButton'] ? 'true' : 'false' ) ?>,
|
330 |
+
showCloseButton: <?php echo ( isset( $mfbfw['showCloseButton'] ) && $mfbfw['showCloseButton'] ? 'true' : 'false' ) ?>,
|
331 |
+
arrows: <?php echo ( isset( $mfbfw['showNavArrows'] ) && $mfbfw['showNavArrows'] ? 'true' : 'false' ) ?>,
|
332 |
+
clickContent: <?php echo ( isset( $mfbfw['hideOnContentClick'] ) && $mfbfw['hideOnContentClick'] ? '"close"' : 'false' ) ?>,
|
333 |
+
clickSlide: <?php echo ( isset( $mfbfw['hideOnOverlayClick'] ) && $mfbfw['hideOnOverlayClick'] ? 'function(current, event) {return current.type === "image" ? "close" : false;}' : 'false' ) ?>,
|
334 |
+
wheel: <?php echo ( isset( $mfbfw['mouseWheel'] ) && $mfbfw['mouseWheel'] ? 'true' : 'false' ) ?>,
|
335 |
+
toolbar: <?php echo ( isset( $mfbfw['showToolbar'] ) && $mfbfw['showToolbar'] ? 'true' : 'false' ) ?>,
|
336 |
+
preventCaptionOverlap: true,
|
337 |
+
onInit: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnStart'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnStart'] ? $mfbfw['callbackOnStart'] . ',' : 'function() { },' ) ?>
|
338 |
+
onDeactivate: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnCancel'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnCancel'] ? $mfbfw['callbackOnCancel'] . ',' : 'function() { },' ) ?>
|
339 |
+
beforeClose: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnCleanup'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnCleanup'] ? $mfbfw['callbackOnCleanup'] . ',' : 'function() { },' ) ?>
|
340 |
+
afterShow: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnComplete'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnComplete'] ? $mfbfw['callbackOnComplete'] . ',' : 'function() { },' ) ?>
|
341 |
+
afterClose: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnClose'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnClose'] ? $mfbfw['callbackOnClose'] . ',' : 'function() { },' ) ?>
|
342 |
+
caption : <?php echo $caption ?>,
|
343 |
+
afterLoad : <?php echo $afterLoad ?>,
|
344 |
+
<?php echo $frameSize ?>
|
|
|
|
|
345 |
});
|
346 |
+
<?php if ( isset( $mfbfw['extraCallsEnable'] ) && $mfbfw['extraCallsEnable'] ) {
|
347 |
+
echo "/* Extra Calls */";
|
348 |
+
echo $mfbfw['extraCallsData'];
|
349 |
+
} ?>
|
350 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
})
|
352 |
</script>
|
353 |
<!-- END Fancybox for WordPress -->
|
354 |
+
<?php
|
355 |
}
|
356 |
}
|
357 |
|
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: 3.4
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 3.1.
|
7 |
License: GPL/MIT
|
8 |
|
9 |
Seamlessly integrates FancyBox lightbox into your WordPress blog: Upload, activate, and you're done. Additional configuration optional.
|
@@ -31,6 +31,9 @@ If you enjoy using FancyBox lightbox for WordPress please leave a [positive feed
|
|
31 |
|
32 |
== Changelog ==
|
33 |
|
|
|
|
|
|
|
34 |
= 3.1.1 =
|
35 |
* Removed print_r from fancybox.php
|
36 |
|
3 |
Tags: fancybox, lightbox, jquery, gallery, image, images, photo, photos, picture, pictures, zoom
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 3.1.2
|
7 |
License: GPL/MIT
|
8 |
|
9 |
Seamlessly integrates FancyBox lightbox into your WordPress blog: Upload, activate, and you're done. Additional configuration optional.
|
31 |
|
32 |
== Changelog ==
|
33 |
|
34 |
+
= 3.1.2 =
|
35 |
+
* Fixed "All links get the fancybox class"
|
36 |
+
|
37 |
= 3.1.1 =
|
38 |
* Removed print_r from fancybox.php
|
39 |
|