Version Description
- Add External Featured Image Slider.
=
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 1.4.5 |
Comparing to | |
See all releases |
Code changes from version 1.4.4 to 1.4.5
- admin/html/css/blink.css +7 -0
- admin/html/live-preview.html +6 -0
- admin/html/menu.html +25 -3
- admin/html/slider-meta-box.html +14 -0
- admin/meta-box.php +100 -108
- featured-image-from-url.php +1 -1
- readme.txt +17 -3
admin/html/css/blink.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.blink_me {
|
2 |
+
animation: blinker 2s linear infinite;
|
3 |
+
}
|
4 |
+
|
5 |
+
@keyframes blinker {
|
6 |
+
50% { opacity: 0.0; }
|
7 |
+
}
|
admin/html/live-preview.html
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style><?php include 'css/blink.css' ?></style>
|
2 |
+
|
3 |
+
<a id="fifu_slider"
|
4 |
+
class="blink_me"
|
5 |
+
href="http://fifu.marceljm.com/"
|
6 |
+
style="<?php echo $show_slider ?>" >Live preview</a>
|
admin/html/menu.html
CHANGED
@@ -22,7 +22,7 @@
|
|
22 |
|
23 |
<div class="greybox">
|
24 |
|
25 |
-
<p>All functionalities created for external images are now available for <b>external videos</b> (from YouTube), everything in one plugin.
|
26 |
|
27 |
<iframe src="https://www.youtube.com/embed/LuynS-Y-fZs" height="402" width="715" allowfullscreen="" frameborder="0"></iframe>
|
28 |
|
@@ -137,7 +137,7 @@
|
|
137 |
|
138 |
<p/>
|
139 |
|
140 |
-
|
141 |
|
142 |
<input type="submit" value="Submit" disabled>
|
143 |
|
@@ -187,6 +187,28 @@
|
|
187 |
|
188 |
<p>Make your front page cool! Choose a hover effect in the plugin settings to be applied to all external featured images of your posts on your main page. <b>Featured Image From URL Premium</b> has 18 hover effects available. <a href="http://marceljm.com/wordpress/featured-image-from-url-premium#hover" targe="_blank">Check it out</a>.<p/>
|
189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
</div>
|
191 |
|
192 |
</div>
|
@@ -197,7 +219,7 @@
|
|
197 |
|
198 |
<div class="greybox">
|
199 |
|
200 |
-
<p>If the external featured images of your posts or pages aren't being shown, congratulations: you're using a nonstandard theme! But there is a last hope. Enabling the toggle below, your external featured images will be associated to a symbolic file in your Media Library. It's
|
201 |
|
202 |
</div>
|
203 |
|
22 |
|
23 |
<div class="greybox">
|
24 |
|
25 |
+
<p>All functionalities created for external images are now available for <b>external videos</b> (from YouTube), everything in one plugin. You can still apply your <b>CSS style</b> or <b>18 hover effects</b> to the images and use a <b>slider of images</b> as featured image. Supports the <b>last WooCommerce version</b>. Click <a href="http://marceljm.com/wordpress/featured-image-from-url-premium/" targe="_blank">here</a> to know more. Or you can have a <a href="http://fifu.marceljm.com/" targe="_blank">Live Preview</a>.<p/>
|
26 |
|
27 |
<iframe src="https://www.youtube.com/embed/LuynS-Y-fZs" height="402" width="715" allowfullscreen="" frameborder="0"></iframe>
|
28 |
|
137 |
|
138 |
<p/>
|
139 |
|
140 |
+
<input id="fifu_input_css" type="text" name="fifu_input_css" style="width:675px" disabled>
|
141 |
|
142 |
<input type="submit" value="Submit" disabled>
|
143 |
|
187 |
|
188 |
<p>Make your front page cool! Choose a hover effect in the plugin settings to be applied to all external featured images of your posts on your main page. <b>Featured Image From URL Premium</b> has 18 hover effects available. <a href="http://marceljm.com/wordpress/featured-image-from-url-premium#hover" targe="_blank">Check it out</a>.<p/>
|
189 |
|
190 |
+
<select id="select_hover" style="width:100%">
|
191 |
+
<option value=""></option>
|
192 |
+
<option value="hover17">315 Degrees</option>
|
193 |
+
<option value="hover02">360 Degrees</option>
|
194 |
+
<option value="hover07">Blur</option>
|
195 |
+
<option value="hover10">Blur Gray Scale</option>
|
196 |
+
<option value="hover04">Brighten</option>
|
197 |
+
<option value="hover15">Circle</option>
|
198 |
+
<option value="hover13">Flashing</option>
|
199 |
+
<option value="hover08">Gray Scale</option>
|
200 |
+
<option value="hover16">Horizontal Rotation</option>
|
201 |
+
<option value="hover12">Opacity Color</option>
|
202 |
+
<option value="hover11">Opacity White</option>
|
203 |
+
<option value="hover18">Rainbow</option>
|
204 |
+
<option value="hover06">Rotate</option>
|
205 |
+
<option value="hover09">Sepia</option>
|
206 |
+
<option value="hover14">Shine</option>
|
207 |
+
<option value="hover05">Vertical Rotation</option>
|
208 |
+
<option value="hover01">Zoom In</option>
|
209 |
+
<option value="hover03">Zoom Out</option>
|
210 |
+
</select>
|
211 |
+
|
212 |
</div>
|
213 |
|
214 |
</div>
|
219 |
|
220 |
<div class="greybox">
|
221 |
|
222 |
+
<p>If the external featured images of your posts or pages aren't being shown, congratulations: you're using a nonstandard theme! But there is a last hope. Enabling the toggle below, your external featured images will be associated to a symbolic file in your Media Library. It's a desperate attempt to cheat your theme that will think that there is an internal image there. Then when the theme tries to show the image, that doesn't exist, a function will replace the symbolic file by your URL on execution time. It should allow you to use the main feature of this plugin, but secondary ones, such as "External Featured Image Slider" may not work.</p>
|
223 |
|
224 |
</div>
|
225 |
|
admin/html/slider-meta-box.html
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- show URL field and preview button if URL was not provided yet -->
|
2 |
+
|
3 |
+
<input disabled id="fifu_slider_input_url_<?php echo $i; ?>"
|
4 |
+
type="text"
|
5 |
+
name="fifu_slider_input_url_<?php echo $i; ?>"
|
6 |
+
placeholder="URL"
|
7 |
+
value="<?php echo $url[$i]; ?>"
|
8 |
+
style="<?php echo $width, $margin, $show_url[$i] ?>" />
|
9 |
+
|
10 |
+
<a disabled id="fifu_slider_button_<?php echo $i; ?>"
|
11 |
+
class="button"
|
12 |
+
onClick="sliderPreviewImage(<?php echo $i; ?>);"
|
13 |
+
style="<?php echo $align, $margin, $show_button[$i] ?>" >Preview</a>
|
14 |
+
|
admin/meta-box.php
CHANGED
@@ -3,51 +3,34 @@
|
|
3 |
add_action('add_meta_boxes', 'fifu_insert_meta_box');
|
4 |
|
5 |
function fifu_insert_meta_box() {
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
'fifu_show_elements',
|
35 |
-
$post_type,
|
36 |
-
'side',
|
37 |
-
'low'
|
38 |
-
);
|
39 |
-
}
|
40 |
-
|
41 |
-
if ($post_type)
|
42 |
-
add_meta_box(
|
43 |
-
'videoUrlMetaBox',
|
44 |
-
'External Featured Video',
|
45 |
-
'fifu_show_advertisement',
|
46 |
-
$post_type,
|
47 |
-
'side',
|
48 |
-
'low'
|
49 |
-
);
|
50 |
-
}
|
51 |
}
|
52 |
|
53 |
function fifu_show_elements($post) {
|
@@ -62,86 +45,95 @@ function fifu_show_elements($post) {
|
|
62 |
|
63 |
if ($url) {
|
64 |
$show_url = $show_button = $show_sirv = 'display:none;';
|
65 |
-
$show_alt = $show_image = $show_link =
|
66 |
} else {
|
67 |
-
$show_alt = $show_image = $show_link =
|
68 |
$show_url = $show_button = '';
|
69 |
$show_sirv = ($is_sirv_active ? '' : 'display:none;');
|
70 |
}
|
71 |
|
72 |
include 'html/meta-box.html';
|
73 |
-
|
74 |
-
if (get_post_type(get_the_ID()) == 'post')
|
75 |
-
include 'html/hover.html';
|
76 |
}
|
77 |
|
78 |
function fifu_show_advertisement($post) {
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
|
84 |
-
|
85 |
}
|
86 |
|
87 |
function fifu_wc_show_elements($post) {
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
|
110 |
add_action('save_post', 'fifu_save_properties');
|
111 |
|
112 |
function fifu_save_properties($post_id) {
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
}
|
147 |
|
3 |
add_action('add_meta_boxes', 'fifu_insert_meta_box');
|
4 |
|
5 |
function fifu_insert_meta_box() {
|
6 |
+
$post_types = array('post', 'page', 'product', get_option('fifu_cpt0'), get_option('fifu_cpt1'), get_option('fifu_cpt2'), get_option('fifu_cpt3'), get_option('fifu_cpt4'));
|
7 |
+
|
8 |
+
foreach ($post_types as $post_type) {
|
9 |
+
if ($post_type == 'product') {
|
10 |
+
add_meta_box(
|
11 |
+
'urlMetaBox', 'External Product Image', 'fifu_show_elements', $post_type, 'side', 'low'
|
12 |
+
);
|
13 |
+
if (get_option('fifu_woocommerce') == 'toggleon') {
|
14 |
+
add_meta_box(
|
15 |
+
'wooCommerceGalleryMetaBox', 'External Product Gallery', 'fifu_wc_show_elements', $post_type, 'side', 'low'
|
16 |
+
);
|
17 |
+
}
|
18 |
+
} else {
|
19 |
+
if ($post_type)
|
20 |
+
add_meta_box(
|
21 |
+
'imageUrlMetaBox', 'External Featured Image', 'fifu_show_elements', $post_type, 'side', 'low'
|
22 |
+
);
|
23 |
+
}
|
24 |
+
|
25 |
+
if ($post_type) {
|
26 |
+
add_meta_box(
|
27 |
+
'sliderImageUrlMetaBox', 'External Featured Image Slider', 'fifu_slider_show_elements', $post_type, 'side', 'low'
|
28 |
+
);
|
29 |
+
add_meta_box(
|
30 |
+
'videoUrlMetaBox', 'External Featured Video', 'fifu_show_advertisement', $post_type, 'side', 'low'
|
31 |
+
);
|
32 |
+
}
|
33 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
|
36 |
function fifu_show_elements($post) {
|
45 |
|
46 |
if ($url) {
|
47 |
$show_url = $show_button = $show_sirv = 'display:none;';
|
48 |
+
$show_alt = $show_image = $show_link = '';
|
49 |
} else {
|
50 |
+
$show_alt = $show_image = $show_link = 'display:none;';
|
51 |
$show_url = $show_button = '';
|
52 |
$show_sirv = ($is_sirv_active ? '' : 'display:none;');
|
53 |
}
|
54 |
|
55 |
include 'html/meta-box.html';
|
|
|
|
|
|
|
56 |
}
|
57 |
|
58 |
function fifu_show_advertisement($post) {
|
59 |
+
$margin = 'margin-top:10px;';
|
60 |
+
$width = 'width:100%;';
|
61 |
+
$height = 'height:266px;';
|
62 |
+
$align = 'text-align:left;';
|
63 |
|
64 |
+
include 'html/meta-box-advertisement.html';
|
65 |
}
|
66 |
|
67 |
function fifu_wc_show_elements($post) {
|
68 |
+
$margin = 'margin-top:1px;';
|
69 |
+
$width = 'width:70%;';
|
70 |
+
$height = 'height:266px;';
|
71 |
+
$align = 'text-align:left;';
|
72 |
+
$altWidth = 'width:86%;';
|
73 |
+
|
74 |
+
for ($i = 0; $i < 10; $i++) {
|
75 |
+
$url[$i] = get_post_meta($post->ID, 'fifu_image_url_' . $i, true);
|
76 |
+
$alt[$i] = get_post_meta($post->ID, 'fifu_image_alt_' . $i, true);
|
77 |
+
|
78 |
+
if ($url[$i]) {
|
79 |
+
$show_url[$i] = $show_button[$i] = 'display:none;';
|
80 |
+
$show_alt[$i] = $show_image[$i] = $show_link[$i] = '';
|
81 |
+
} else {
|
82 |
+
$show_alt[$i] = $show_image[$i] = $show_link[$i] = 'display:none;';
|
83 |
+
$show_url[$i] = $show_button[$i] = '';
|
84 |
+
}
|
85 |
+
|
86 |
+
include 'html/wc-meta-box.html';
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
function fifu_slider_show_elements($post) {
|
91 |
+
$margin = 'margin-top:1px;';
|
92 |
+
$width = 'width:70%;';
|
93 |
+
$height = 'height:266px;';
|
94 |
+
$align = 'text-align:left;';
|
95 |
+
$altWidth = 'width:86%;';
|
96 |
+
|
97 |
+
for ($i = 1; $i < 5; $i++)
|
98 |
+
include 'html/slider-meta-box.html';
|
99 |
+
include 'html/live-preview.html';
|
100 |
}
|
101 |
|
102 |
add_action('save_post', 'fifu_save_properties');
|
103 |
|
104 |
function fifu_save_properties($post_id) {
|
105 |
+
if (isset($_POST['fifu_input_url'])) {
|
106 |
+
update_post_meta($post_id, 'fifu_image_url', esc_url($_POST['fifu_input_url']));
|
107 |
+
|
108 |
+
if (get_option('fifu_attachment_id') && !get_post_thumbnail_id($post_id) && esc_url($_POST['fifu_input_url']))
|
109 |
+
set_post_thumbnail($post_id, get_option('fifu_attachment_id'));
|
110 |
+
}
|
111 |
+
|
112 |
+
if (isset($_POST['fifu_input_alt']))
|
113 |
+
update_post_meta($post_id, 'fifu_image_alt', wp_strip_all_tags($_POST['fifu_input_alt']));
|
114 |
+
|
115 |
+
if (get_post_type(get_the_ID()) == 'product') {
|
116 |
+
$count = 10;
|
117 |
+
for ($i = 0; $i < 10; $i++) {
|
118 |
+
if (isset($_POST['fifu_input_url_' . $i]) && isset($_POST['fifu_input_alt_' . $i])) {
|
119 |
+
if ($_POST['fifu_input_url_' . $i] != '' && $_POST['fifu_input_alt_' . $i] != '') {
|
120 |
+
update_post_meta($post_id, 'fifu_image_url_' . $i, esc_url($_POST['fifu_input_url_' . $i]));
|
121 |
+
update_post_meta($post_id, 'fifu_image_alt_' . $i, wp_strip_all_tags($_POST['fifu_input_alt_' . $i]));
|
122 |
+
if (get_option('fifu_attachment_id') && !get_post_thumbnail_id($post_id) && esc_url($_POST['fifu_input_url_' . $i]))
|
123 |
+
set_post_thumbnail($post_id, get_option('fifu_attachment_id'));
|
124 |
+
} else {
|
125 |
+
delete_post_meta($post_id, 'fifu_image_url_' . $i);
|
126 |
+
delete_post_meta($post_id, 'fifu_image_alt_' . $i);
|
127 |
+
$count--;
|
128 |
+
}
|
129 |
+
}
|
130 |
+
}
|
131 |
+
if ($count == 0 && (isset($_POST['fifu_input_url']) && !esc_url($_POST['fifu_input_url'])) && get_post_thumbnail_id($post_id) == get_option('fifu_attachment_id'))
|
132 |
+
delete_post_thumbnail($post_id);
|
133 |
+
}
|
134 |
+
else {
|
135 |
+
if ((isset($_POST['fifu_input_url']) && !esc_url($_POST['fifu_input_url'])) && get_post_thumbnail_id($post_id) == get_option('fifu_attachment_id'))
|
136 |
+
delete_post_thumbnail($post_id);
|
137 |
+
}
|
138 |
}
|
139 |
|
featured-image-from-url.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* Plugin Name: Featured Image From URL
|
5 |
* Description: Allows to use an external image as Featured Image of your post, page or Custom Post Type, such as WooCommerce Product (supports Product Gallery also).
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Marcel Jacques Machado
|
8 |
* Author URI: http://marceljm.com/wordpress/featured-image-from-url-premium/
|
9 |
*/
|
3 |
/*
|
4 |
* Plugin Name: Featured Image From URL
|
5 |
* Description: Allows to use an external image as Featured Image of your post, page or Custom Post Type, such as WooCommerce Product (supports Product Gallery also).
|
6 |
+
* Version: 1.4.5
|
7 |
* Author: Marcel Jacques Machado
|
8 |
* Author URI: http://marceljm.com/wordpress/featured-image-from-url-premium/
|
9 |
*/
|
readme.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
=== Plugin Name ===
|
2 |
Contributors: marceljm
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8BLDLZ3HDBGQG
|
4 |
-
Tags: featured image, external featured image, featured image from url, url featured image, featured, image, external, url, flickr, s3, picasa, woocommerce, product image, product gallery, product, gallery, column, list, page, post, all, content, custom, type, custom post type, category, video, external video, youtube, featured video, hover, effects, hover effects, sirv, wp all import, css, style
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.6.1
|
7 |
Stable tag: 4.6.1
|
@@ -32,11 +32,19 @@ Features:
|
|
32 |
|
33 |
**Premium Version:**
|
34 |
|
35 |
-
All functionalities created for external images are now available for **external videos** (from YouTube), everything in one plugin.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
*WooCommerce compatibility: 2.6.X. and later.*
|
38 |
|
39 |
-
**<a href="http://fifu.marceljm.com/
|
40 |
|
41 |
[youtube https://www.youtube.com/watch?v=LuynS-Y-fZs]
|
42 |
|
@@ -253,6 +261,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
253 |
= 1.4.4 =
|
254 |
* Bug fixes.
|
255 |
|
|
|
|
|
|
|
256 |
== Upgrade Notice ==
|
257 |
|
258 |
= 1.0 =
|
@@ -342,3 +353,6 @@ was removed. To finish, a Premium version is now been presented.
|
|
342 |
|
343 |
= 1.4.4 =
|
344 |
* Bug fixes.
|
|
|
|
|
|
1 |
=== Plugin Name ===
|
2 |
Contributors: marceljm
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8BLDLZ3HDBGQG
|
4 |
+
Tags: featured image, external featured image, featured image from url, url featured image, featured, image, external, url, flickr, s3, picasa, woocommerce, product image, product gallery, product, gallery, column, list, page, post, all, content, custom, type, custom post type, category, video, external video, youtube, featured video, hover, effects, hover effects, sirv, wp all import, css, style, slider
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.6.1
|
7 |
Stable tag: 4.6.1
|
32 |
|
33 |
**Premium Version:**
|
34 |
|
35 |
+
All functionalities created for external images are now available for **external videos** (from YouTube), everything in one plugin.
|
36 |
+
|
37 |
+
And you still can:
|
38 |
+
|
39 |
+
* use a **slider** of images as featured image;
|
40 |
+
|
41 |
+
* apply your own **CSS style** or **<a href="http://marceljm.com/wordpress/featured-image-from-url-premium/#hover">18 hover effects</a>** to the images;
|
42 |
+
|
43 |
+
Click <a href="http://marceljm.com/wordpress/featured-image-from-url-premium/" targe="_blank">here</a> to know more.
|
44 |
|
45 |
*WooCommerce compatibility: 2.6.X. and later.*
|
46 |
|
47 |
+
**<a href="http://fifu.marceljm.com/">Live Preview</a>**
|
48 |
|
49 |
[youtube https://www.youtube.com/watch?v=LuynS-Y-fZs]
|
50 |
|
261 |
= 1.4.4 =
|
262 |
* Bug fixes.
|
263 |
|
264 |
+
= 1.4.5 =
|
265 |
+
* Add External Featured Image Slider.
|
266 |
+
|
267 |
== Upgrade Notice ==
|
268 |
|
269 |
= 1.0 =
|
353 |
|
354 |
= 1.4.4 =
|
355 |
* Bug fixes.
|
356 |
+
|
357 |
+
= 1.4.5 =
|
358 |
+
* Add External Featured Image Slider.
|