Version Description
- If your theme don't show Featured Image (internal or external) in Posts, Pages or Products, now it's possible to include that at the beginning of the content automatically.
=
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 1.1.3 |
Comparing to | |
See all releases |
Code changes from version 1.1.2 to 1.1.3
- admin/html/js/menu.js +14 -0
- admin/html/menu.html +36 -0
- admin/menu.php +3 -0
- featured-image-from-url.php +1 -1
- includes/thumbnail.php +9 -0
- readme.txt +15 -2
admin/html/js/menu.js
CHANGED
@@ -40,4 +40,18 @@ jQuery(function () {
|
|
40 |
});
|
41 |
});
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
});
|
|
40 |
});
|
41 |
});
|
42 |
|
43 |
+
jQuery("#fifu_form_content").submit(function () {
|
44 |
+
|
45 |
+
var frm = jQuery("#fifu_form_content");
|
46 |
+
|
47 |
+
jQuery.ajax({
|
48 |
+
type: frm.attr('method'),
|
49 |
+
url: url,
|
50 |
+
data: frm.serialize(),
|
51 |
+
success: function (data) {
|
52 |
+
//alert('saved');
|
53 |
+
}
|
54 |
+
});
|
55 |
+
});
|
56 |
});
|
57 |
+
|
admin/html/menu.html
CHANGED
@@ -56,6 +56,42 @@
|
|
56 |
|
57 |
</div>
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
<div class="box">
|
60 |
|
61 |
<h2>Make a Donation</h2>
|
56 |
|
57 |
</div>
|
58 |
|
59 |
+
<div class="box">
|
60 |
+
|
61 |
+
<h2>Featured Image in Content</h2>
|
62 |
+
|
63 |
+
<div class="greybox">
|
64 |
+
|
65 |
+
<p>Some themes don't show the Featured Image in the content. If it is your case and you would like to show the Featured Image there, just enable the toggle. The Featured Image will appear at the beginning of the content, before any text or image.</p>
|
66 |
+
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<p/>
|
70 |
+
|
71 |
+
<form
|
72 |
+
id="fifu_form_content"
|
73 |
+
action="javascript:void(0)"
|
74 |
+
method="post">
|
75 |
+
|
76 |
+
<input
|
77 |
+
type="image"
|
78 |
+
href="javascript:void(0)"
|
79 |
+
id="fifu_toggle_content"
|
80 |
+
onclick="invert('content')"
|
81 |
+
name="fifu_toggle_content"
|
82 |
+
class="<?php echo $enable_content; ?>"
|
83 |
+
value=" "
|
84 |
+
style="<?php echo $show_content_button; ?>">
|
85 |
+
|
86 |
+
<input
|
87 |
+
type="hidden"
|
88 |
+
id="fifu_input_content"
|
89 |
+
name="fifu_input_content"
|
90 |
+
value="" >
|
91 |
+
</form>
|
92 |
+
|
93 |
+
</div>
|
94 |
+
|
95 |
<div class="box">
|
96 |
|
97 |
<h2>Make a Donation</h2>
|
admin/menu.php
CHANGED
@@ -20,6 +20,7 @@ function fifu_get_menu_html() {
|
|
20 |
|
21 |
$enable_backlink = get_option('fifu_backlink');
|
22 |
$enable_woocommerce = get_option('fifu_woocommerce');
|
|
|
23 |
|
24 |
$show_woocommerce_button = "display:block";
|
25 |
$output = shell_exec('uname -s');
|
@@ -43,11 +44,13 @@ function fifu_get_menu_html() {
|
|
43 |
function fifu_get_menu_settings() {
|
44 |
fifu_get_setting('fifu_backlink');
|
45 |
fifu_get_setting('fifu_woocommerce');
|
|
|
46 |
}
|
47 |
|
48 |
function fifu_update_menu_options() {
|
49 |
fifu_update_option('fifu_input_backlink', 'fifu_backlink');
|
50 |
fifu_update_option('fifu_input_woocommerce', 'fifu_woocommerce');
|
|
|
51 |
}
|
52 |
|
53 |
function fifu_get_setting($type) {
|
20 |
|
21 |
$enable_backlink = get_option('fifu_backlink');
|
22 |
$enable_woocommerce = get_option('fifu_woocommerce');
|
23 |
+
$enable_content = get_option('fifu_content');
|
24 |
|
25 |
$show_woocommerce_button = "display:block";
|
26 |
$output = shell_exec('uname -s');
|
44 |
function fifu_get_menu_settings() {
|
45 |
fifu_get_setting('fifu_backlink');
|
46 |
fifu_get_setting('fifu_woocommerce');
|
47 |
+
fifu_get_setting('fifu_content');
|
48 |
}
|
49 |
|
50 |
function fifu_update_menu_options() {
|
51 |
fifu_update_option('fifu_input_backlink', 'fifu_backlink');
|
52 |
fifu_update_option('fifu_input_woocommerce', 'fifu_woocommerce');
|
53 |
+
fifu_update_option('fifu_input_content', 'fifu_content');
|
54 |
}
|
55 |
|
56 |
function fifu_get_setting($type) {
|
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 WooCommerce product. And external images in WooCommerce Product Gallery.
|
6 |
-
* Version: 1.1.
|
7 |
* Author: Marcel Jacques Machado
|
8 |
* Author URI: http://marceljm.com
|
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 WooCommerce product. And external images in WooCommerce Product Gallery.
|
6 |
+
* Version: 1.1.3
|
7 |
* Author: Marcel Jacques Machado
|
8 |
* Author URI: http://marceljm.com
|
9 |
*/
|
includes/thumbnail.php
CHANGED
@@ -47,3 +47,12 @@ function fifu_replace($html, $post_id) {
|
|
47 |
function fifu_get_html($id, $image_url, $image_alt) {
|
48 |
return sprintf('<!-- Featured Image from URL: http://marceljm.com/wordpress/featured-image-from-url/ --> <img src="%s" alt="%s"></img>', $image_url, $image_alt);
|
49 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
function fifu_get_html($id, $image_url, $image_alt) {
|
48 |
return sprintf('<!-- Featured Image from URL: http://marceljm.com/wordpress/featured-image-from-url/ --> <img src="%s" alt="%s"></img>', $image_url, $image_alt);
|
49 |
}
|
50 |
+
|
51 |
+
add_filter('the_content', 'fifu_add_to_content');
|
52 |
+
|
53 |
+
function fifu_add_to_content($content) {
|
54 |
+
if (is_singular() && has_post_thumbnail() && get_option('fifu_content') == 'toggleon')
|
55 |
+
return get_the_post_thumbnail() . $content;
|
56 |
+
else
|
57 |
+
return $content;
|
58 |
+
}
|
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, woocommerce, product image, product gallery, product, gallery, column, list, page, post, all
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.4.1
|
7 |
Stable tag: 4.4.1
|
@@ -16,7 +16,9 @@ Allows you to use an external image (from Flickr, Picasa, Amazon S3, anywhere et
|
|
16 |
|
17 |
It's also possible to use external images in the WooCommerce Product Gallery (since your site is hosted on a Linux server).
|
18 |
|
19 |
-
|
|
|
|
|
20 |
|
21 |
== Installation ==
|
22 |
|
@@ -79,6 +81,10 @@ And a new functionality was added in this last version: now, when you access "Al
|
|
79 |
|
80 |
* Just click on "Screen Options", and check or uncheck "Featured Image".
|
81 |
|
|
|
|
|
|
|
|
|
82 |
== Screenshots ==
|
83 |
|
84 |
1. This plugin allows you to use an external image as Featured Image of your pages. Just fill the URL field with the image address and click on preview button.
|
@@ -145,6 +151,9 @@ And a new functionality was added in this last version: now, when you access "Al
|
|
145 |
= 1.1.2 =
|
146 |
* Menu toggles weren't been shown on Firefox. Fixed!
|
147 |
|
|
|
|
|
|
|
148 |
== Upgrade Notice ==
|
149 |
|
150 |
= 1.0 =
|
@@ -164,3 +173,7 @@ And a new functionality was added in this last version: now, when you access "Al
|
|
164 |
|
165 |
= 1.1.2 =
|
166 |
* Menu toggles weren't been shown on Firefox. Fixed!
|
|
|
|
|
|
|
|
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, woocommerce, product image, product gallery, product, gallery, column, list, page, post, all, content
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.4.1
|
7 |
Stable tag: 4.4.1
|
16 |
|
17 |
It's also possible to use external images in the WooCommerce Product Gallery (since your site is hosted on a Linux server).
|
18 |
|
19 |
+
Besides that, when you access "All Posts", "All Pages" or "Products" in admin menu, the Featured Images (internal or external) are shown in a new column.
|
20 |
+
|
21 |
+
And if your theme don't show Featured Image (internal or external) in Posts, Pages or Products, now it's possible to include that at the beginning of the content automatically.
|
22 |
|
23 |
== Installation ==
|
24 |
|
81 |
|
82 |
* Just click on "Screen Options", and check or uncheck "Featured Image".
|
83 |
|
84 |
+
= How to show the Featured Image (internal or external) at the beginning of the content of a Post, Page or Product? =
|
85 |
+
|
86 |
+
* There is a toggle (on/off) in Featured Image From URL settings. This functionality was added to attend some themes that didn't show the Featured Image before the content of Posts, Pages or Products.
|
87 |
+
|
88 |
== Screenshots ==
|
89 |
|
90 |
1. This plugin allows you to use an external image as Featured Image of your pages. Just fill the URL field with the image address and click on preview button.
|
151 |
= 1.1.2 =
|
152 |
* Menu toggles weren't been shown on Firefox. Fixed!
|
153 |
|
154 |
+
= 1.1.3 =
|
155 |
+
* If your theme don't show Featured Image (internal or external) in Posts, Pages or Products, now it's possible to include that at the beginning of the content automatically.
|
156 |
+
|
157 |
== Upgrade Notice ==
|
158 |
|
159 |
= 1.0 =
|
173 |
|
174 |
= 1.1.2 =
|
175 |
* Menu toggles weren't been shown on Firefox. Fixed!
|
176 |
+
|
177 |
+
= 1.1.3 =
|
178 |
+
* If your theme don't show Featured Image (internal or external) in Posts, Pages or Products, now it's possible to include that at the beginning of the content automatically.
|
179 |
+
|