Featured Image From URL - Version 1.6.1

Version Description

  • Bug fix.

=

Download this release

Release Info

Developer marceljm
Plugin Icon 128x128 Featured Image From URL
Version 1.6.1
Comparing to
See all releases

Code changes from version 1.6.0 to 1.6.1

featured-image-from-url.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  * Plugin Name: Featured Image From URL
5
  * 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.
6
- * Version: 1.6.0
7
  * Author: Marcel Jacques Machado
8
  * Author URI: http://featuredimagefromurl.com/
9
  */
3
  /*
4
  * Plugin Name: Featured Image From URL
5
  * 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.
6
+ * Version: 1.6.1
7
  * Author: Marcel Jacques Machado
8
  * Author URI: http://featuredimagefromurl.com/
9
  */
includes/thumbnail.php CHANGED
@@ -71,23 +71,27 @@ function fifu_add_to_content($content) {
71
  add_filter('wp_get_attachment_url', 'fifu_replace_attachment_url', 10, 2);
72
 
73
  function fifu_replace_attachment_url($att_url, $att_id) {
74
- $url = get_post_meta(get_the_ID(), 'fifu_image_url', true);
75
- if ($url)
76
- return $url;
 
 
77
  return $att_url;
78
  }
79
 
80
  add_filter('wp_get_attachment_image_src', 'fifu_replace_attachment_image_src', 10, 2);
81
 
82
- function fifu_replace_attachment_image_src($image, $attachment_id) {
83
- $url = get_post_meta(get_the_ID(), 'fifu_image_url', true);
84
- if ($url) {
85
- return array(
86
- $url,
87
- 0,
88
- 0,
89
- false
90
- );
 
 
91
  }
92
  return $image;
93
  }
71
  add_filter('wp_get_attachment_url', 'fifu_replace_attachment_url', 10, 2);
72
 
73
  function fifu_replace_attachment_url($att_url, $att_id) {
74
+ if (att_id == get_post_thumbnail_id(get_the_ID())) {
75
+ $url = get_post_meta(get_the_ID(), 'fifu_image_url', true);
76
+ if ($url)
77
+ $att_url = $url;
78
+ }
79
  return $att_url;
80
  }
81
 
82
  add_filter('wp_get_attachment_image_src', 'fifu_replace_attachment_image_src', 10, 2);
83
 
84
+ function fifu_replace_attachment_image_src($image, $att_id) {
85
+ if ($att_id == get_post_thumbnail_id(get_the_ID())) {
86
+ $url = get_post_meta(get_the_ID(), 'fifu_image_url', true);
87
+ if ($url) {
88
+ return array(
89
+ $url,
90
+ 0,
91
+ 0,
92
+ false
93
+ );
94
+ }
95
  }
96
  return $image;
97
  }
readme.txt CHANGED
@@ -279,6 +279,9 @@ was removed. To finish, a Premium version is now been presented.
279
  = 1.6.0 =
280
  * WP REST API.
281
 
 
 
 
282
  == Upgrade Notice ==
283
 
284
  = 1.0 =
@@ -415,4 +418,7 @@ was removed. To finish, a Premium version is now been presented.
415
  * New support email.
416
 
417
  = 1.6.0 =
418
- * WP REST API.
 
 
 
279
  = 1.6.0 =
280
  * WP REST API.
281
 
282
+ = 1.6.1 =
283
+ * Bug fix.
284
+
285
  == Upgrade Notice ==
286
 
287
  = 1.0 =
418
  * New support email.
419
 
420
  = 1.6.0 =
421
+ * WP REST API.
422
+
423
+ = 1.6.1 =
424
+ * Bug fix.