Version Description
- Bug fix: use the first image as featured image.
Download this release
Release Info
Developer | marceljm |
Plugin | ![]() |
Version | 1.8.3 |
Comparing to | |
See all releases |
Code changes from version 1.8.2 to 1.8.3
- featured-image-from-url.php +1 -1
- includes/external-post.php +11 -7
- readme.txt +6 -0
featured-image-from-url.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Featured Image From URL
|
5 |
* Plugin URI: http://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: 1.8.
|
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: http://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: 1.8.3
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
includes/external-post.php
CHANGED
@@ -71,18 +71,21 @@ function fifu_first_url_in_content($post_id) {
|
|
71 |
if (!$matches[0])
|
72 |
return;
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
79 |
}
|
80 |
-
|
81 |
-
|
|
|
82 |
$aux1 = explode("src='", $matches[0][0]);
|
83 |
if ($aux1)
|
84 |
$aux2 = explode("'", $aux1[1]);
|
85 |
}
|
|
|
86 |
return $matches && $matches[0] ? $aux2[0] : null;
|
87 |
}
|
88 |
|
@@ -90,3 +93,4 @@ function fifu_update_fake_attach_id($post_id) {
|
|
90 |
if (get_option('fifu_fake_attach_id') && !get_post_thumbnail_id($post_id))
|
91 |
set_post_thumbnail($post_id, get_option('fifu_fake_attach_id'));
|
92 |
}
|
|
71 |
if (!$matches[0])
|
72 |
return;
|
73 |
|
74 |
+
//double quotes
|
75 |
+
$aux1 = explode('src="', $matches[0][0]);
|
76 |
+
if ($aux1) {
|
77 |
+
error_log($aux1[1]);
|
78 |
+
$aux2 = explode('"', $aux1[1]);
|
79 |
+
error_log($aux2[0]);
|
80 |
}
|
81 |
+
|
82 |
+
//single quotes
|
83 |
+
if (!$aux2[0]) {
|
84 |
$aux1 = explode("src='", $matches[0][0]);
|
85 |
if ($aux1)
|
86 |
$aux2 = explode("'", $aux1[1]);
|
87 |
}
|
88 |
+
|
89 |
return $matches && $matches[0] ? $aux2[0] : null;
|
90 |
}
|
91 |
|
93 |
if (get_option('fifu_fake_attach_id') && !get_post_thumbnail_id($post_id))
|
94 |
set_post_thumbnail($post_id, get_option('fifu_fake_attach_id'));
|
95 |
}
|
96 |
+
|
readme.txt
CHANGED
@@ -159,6 +159,9 @@ Features:
|
|
159 |
|
160 |
== Changelog ==
|
161 |
|
|
|
|
|
|
|
162 |
= 1.8.2 =
|
163 |
* Bug fix: use the first image as featured image.
|
164 |
|
@@ -363,6 +366,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
363 |
|
364 |
== Upgrade Notice ==
|
365 |
|
|
|
|
|
|
|
366 |
= 1.8.2 =
|
367 |
* Bug fix: use the first image as featured image.
|
368 |
|
159 |
|
160 |
== Changelog ==
|
161 |
|
162 |
+
= 1.8.3 =
|
163 |
+
* Bug fix: use the first image as featured image.
|
164 |
+
|
165 |
= 1.8.2 =
|
166 |
* Bug fix: use the first image as featured image.
|
167 |
|
366 |
|
367 |
== Upgrade Notice ==
|
368 |
|
369 |
+
= 1.8.3 =
|
370 |
+
* Bug fix: use the first image as featured image.
|
371 |
+
|
372 |
= 1.8.2 =
|
373 |
* Bug fix: use the first image as featured image.
|
374 |
|