Version Description
- Bug fix: Lazy Load feature.
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 2.3.8 |
Comparing to | |
See all releases |
Code changes from version 2.3.7 to 2.3.8
- featured-image-from-url.php +1 -1
- includes/html/js/image.js +14 -8
- includes/thumbnail.php +10 -1
- readme.txt +6 -0
featured-image-from-url.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Featured Image from URL
|
5 |
* Plugin URI: https://featuredimagefromurl.com/
|
6 |
* Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
|
7 |
-
* Version: 2.3.
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
4 |
* Plugin Name: Featured Image from URL
|
5 |
* Plugin URI: https://featuredimagefromurl.com/
|
6 |
* Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
|
7 |
+
* Version: 2.3.8
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
includes/html/js/image.js
CHANGED
@@ -1,11 +1,15 @@
|
|
1 |
jQuery(document).ready(function ($) {
|
2 |
// lazy load
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
8 |
|
|
|
9 |
disableClick($);
|
10 |
|
11 |
// for all images at single product page
|
@@ -16,9 +20,11 @@ jQuery(document).ready(function ($) {
|
|
16 |
});
|
17 |
|
18 |
jQuery(window).on('ajaxComplete', function () {
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
22 |
});
|
23 |
|
24 |
jQuery(window).on('load', function () {
|
1 |
jQuery(document).ready(function ($) {
|
2 |
// lazy load
|
3 |
+
if ('<?php echo fifu_is_on("fifu_lazy"); ?>') {
|
4 |
+
jQuery.extend(jQuery.lazyLoadXT, {
|
5 |
+
srcAttr: 'data-src',
|
6 |
+
visibleOnly: false,
|
7 |
+
updateEvent: 'load orientationchange resize scroll touchmove focus hover'
|
8 |
+
});
|
9 |
+
jQuery('img').css('opacity', 1);
|
10 |
+
}
|
11 |
|
12 |
+
// woocommerce lightbox/zoom
|
13 |
disableClick($);
|
14 |
|
15 |
// for all images at single product page
|
20 |
});
|
21 |
|
22 |
jQuery(window).on('ajaxComplete', function () {
|
23 |
+
if ('<?php echo fifu_is_on("fifu_lazy"); ?>') {
|
24 |
+
setTimeout(function () {
|
25 |
+
jQuery(window).lazyLoadXT();
|
26 |
+
}, 300);
|
27 |
+
}
|
28 |
});
|
29 |
|
30 |
jQuery(window).on('load', function () {
|
includes/thumbnail.php
CHANGED
@@ -74,8 +74,17 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size) {
|
|
74 |
$width = fifu_get_attribute('width', $html);
|
75 |
$height = fifu_get_attribute('height', $html);
|
76 |
|
77 |
-
if (fifu_is_on('fifu_lazy') && !is_admin())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
$html = str_replace("src", "data-src", $html);
|
|
|
79 |
|
80 |
$url = get_post_meta($post_id, 'fifu_image_url', true);
|
81 |
$alt = get_post_meta($post_id, 'fifu_image_alt', true);
|
74 |
$width = fifu_get_attribute('width', $html);
|
75 |
$height = fifu_get_attribute('height', $html);
|
76 |
|
77 |
+
if (fifu_is_on('fifu_lazy') && !is_admin()) {
|
78 |
+
// hide image
|
79 |
+
if (strpos('style=', $html) !== false) {
|
80 |
+
$html = (strpos('style="', $html) !== false) ? str_replace('style="', 'style="opacity:0;', $html) : $html;
|
81 |
+
$html = (strpos("style='", $html) !== false) ? str_replace("style='", "style='opacity:0;", $html) : $html;
|
82 |
+
} else
|
83 |
+
$html = str_replace("<img ", "<img style='opacity:0' ", $html);
|
84 |
+
|
85 |
+
// add data-src
|
86 |
$html = str_replace("src", "data-src", $html);
|
87 |
+
}
|
88 |
|
89 |
$url = get_post_meta($post_id, 'fifu_image_url', true);
|
90 |
$alt = get_post_meta($post_id, 'fifu_image_alt', true);
|
readme.txt
CHANGED
@@ -157,6 +157,9 @@ Features:
|
|
157 |
|
158 |
== Changelog ==
|
159 |
|
|
|
|
|
|
|
160 |
= 2.3.7 =
|
161 |
* Improvement: Lazy Load feature will show an animated spinner while image is loading.
|
162 |
|
@@ -538,6 +541,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
538 |
|
539 |
== Upgrade Notice ==
|
540 |
|
|
|
|
|
|
|
541 |
= 2.3.7 =
|
542 |
* Improvement: Lazy Load feature will show an animated spinner while image is loading.
|
543 |
|
157 |
|
158 |
== Changelog ==
|
159 |
|
160 |
+
= 2.3.8 =
|
161 |
+
* Bug fix: Lazy Load feature.
|
162 |
+
|
163 |
= 2.3.7 =
|
164 |
* Improvement: Lazy Load feature will show an animated spinner while image is loading.
|
165 |
|
541 |
|
542 |
== Upgrade Notice ==
|
543 |
|
544 |
+
= 2.3.8 =
|
545 |
+
* Bug fix: Lazy Load feature.
|
546 |
+
|
547 |
= 2.3.7 =
|
548 |
* Improvement: Lazy Load feature will show an animated spinner while image is loading.
|
549 |
|