Featured Image From URL - Version 1.9.8

Version Description

  • Allows to disable auto set image Alt/Title.
Download this release

Release Info

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

Code changes from version 1.9.7 to 1.9.8

admin/html/menu.html CHANGED
@@ -126,6 +126,50 @@
126
 
127
  </div>
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  <div class="box">
130
  <h2>Custom Post Types</h2>
131
  <div class="greybox">
126
 
127
  </div>
128
 
129
+ <div class="box">
130
+
131
+ <h2>Auto Set Image Alt/Title</h2>
132
+
133
+ <div class="greybox">
134
+
135
+ Enable the toggle below to automatically set the attibutes "alt" and "title" of an external image with the title of the post/page. It will have effect when you click on publish/update button of your post/page.
136
+
137
+ </div>
138
+
139
+ <br>
140
+
141
+ <table style="text-align:left">
142
+ <tr>
143
+ <th>
144
+ <form
145
+ id="fifu_form_auto_alt"
146
+ action="javascript:void(0)"
147
+ method="post">
148
+ <input
149
+ type="image"
150
+ href="javascript:void(0)"
151
+ id="fifu_toggle_auto_alt"
152
+ onclick="invert('auto_alt')"
153
+ name="fifu_toggle_auto_alt"
154
+ class="<?php echo $enable_auto_alt; ?>"
155
+ value=""
156
+ style="display:block">
157
+
158
+ <input
159
+ type="hidden"
160
+ id="fifu_input_auto_alt"
161
+ name="fifu_input_auto_alt"
162
+ value="" >
163
+ </form>
164
+ </th>
165
+ <th>
166
+ auto set image alt/title
167
+ </th>
168
+ </tr>
169
+ </table>
170
+
171
+ </div>
172
+
173
  <div class="box">
174
  <h2>Custom Post Types</h2>
175
  <div class="greybox">
admin/menu.php CHANGED
@@ -28,6 +28,7 @@ function fifu_get_menu_html() {
28
  $enable_ovw_first = get_option('fifu_ovw_first');
29
  $column_height = get_option('fifu_column_height');
30
  $enable_priority = get_option('fifu_priority');
 
31
 
32
  $array_cpt = array();
33
  for ($x = 0; $x <= 4; $x++)
@@ -59,6 +60,7 @@ function fifu_get_menu_settings() {
59
  fifu_get_setting('fifu_ovw_first');
60
  fifu_get_setting('fifu_column_height');
61
  fifu_get_setting('fifu_priority');
 
62
 
63
  for ($x = 0; $x <= 4; $x++)
64
  fifu_get_setting('fifu_cpt' . $x);
@@ -72,7 +74,7 @@ function fifu_get_setting($type) {
72
  update_option($type, '');
73
  else if (strpos($type, "fifu_column_height") !== false)
74
  update_option($type, "64");
75
- else if (strpos($type, "wc") !== false)
76
  update_option($type, 'toggleon');
77
  else
78
  update_option($type, 'toggleoff');
@@ -95,6 +97,7 @@ function fifu_update_menu_options() {
95
  fifu_update_option('fifu_input_ovw_first', 'fifu_ovw_first');
96
  fifu_update_option('fifu_input_column_height', 'fifu_column_height');
97
  fifu_update_option('fifu_input_priority', 'fifu_priority');
 
98
 
99
  for ($x = 0; $x <= 4; $x++)
100
  fifu_update_option('fifu_input_cpt' . $x, 'fifu_cpt' . $x);
28
  $enable_ovw_first = get_option('fifu_ovw_first');
29
  $column_height = get_option('fifu_column_height');
30
  $enable_priority = get_option('fifu_priority');
31
+ $enable_auto_alt = get_option('fifu_auto_alt');
32
 
33
  $array_cpt = array();
34
  for ($x = 0; $x <= 4; $x++)
60
  fifu_get_setting('fifu_ovw_first');
61
  fifu_get_setting('fifu_column_height');
62
  fifu_get_setting('fifu_priority');
63
+ fifu_get_setting('fifu_auto_alt');
64
 
65
  for ($x = 0; $x <= 4; $x++)
66
  fifu_get_setting('fifu_cpt' . $x);
74
  update_option($type, '');
75
  else if (strpos($type, "fifu_column_height") !== false)
76
  update_option($type, "64");
77
+ else if (strpos($type, "wc") !== false || strpos($type, "fifu_auto_alt") !== false)
78
  update_option($type, 'toggleon');
79
  else
80
  update_option($type, 'toggleoff');
97
  fifu_update_option('fifu_input_ovw_first', 'fifu_ovw_first');
98
  fifu_update_option('fifu_input_column_height', 'fifu_column_height');
99
  fifu_update_option('fifu_input_priority', 'fifu_priority');
100
+ fifu_update_option('fifu_input_auto_alt', 'fifu_auto_alt');
101
 
102
  for ($x = 0; $x <= 4; $x++)
103
  fifu_update_option('fifu_input_cpt' . $x, 'fifu_cpt' . $x);
admin/meta-box.php CHANGED
@@ -80,7 +80,7 @@ function fifu_save_properties($post_id) {
80
  /* alt */
81
  if (isset($_POST['fifu_input_alt'])) {
82
  $alt = wp_strip_all_tags($_POST['fifu_input_alt']);
83
- $alt = !$alt && $url ? get_the_title() : $alt;
84
  fifu_update_or_delete($post_id, 'fifu_image_alt', $alt);
85
  }
86
  }
80
  /* alt */
81
  if (isset($_POST['fifu_input_alt'])) {
82
  $alt = wp_strip_all_tags($_POST['fifu_input_alt']);
83
+ $alt = !$alt && $url && fifu_is_on('fifu_auto_alt') ? get_the_title() : $alt;
84
  fifu_update_or_delete($post_id, 'fifu_image_alt', $alt);
85
  }
86
  }
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: 1.9.7
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: 1.9.8
8
  * Author: Marcel Jacques Machado
9
  * Author URI: https://www.linkedin.com/in/marceljm/
10
  */
includes/html/script.html CHANGED
@@ -1,4 +1,3 @@
1
- <script>window.jQuery || document.write('<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"><\/script>')</script>
2
  <style><?php include 'css/woo.css' ?></style>
3
 
4
  <script><?php include 'js/image.js' ?></script>
 
1
  <style><?php include 'css/woo.css' ?></style>
2
 
3
  <script><?php include 'js/image.js' ?></script>
readme.txt CHANGED
@@ -159,6 +159,9 @@ Features:
159
 
160
  == Changelog ==
161
 
 
 
 
162
  = 1.9.7 =
163
  * If jQuery is not found, get that from a CDN.
164
 
@@ -408,6 +411,9 @@ was removed. To finish, a Premium version is now been presented.
408
 
409
  == Upgrade Notice ==
410
 
 
 
 
411
  = 1.9.7 =
412
  * If jQuery is not found, get that from a CDN.
413
 
159
 
160
  == Changelog ==
161
 
162
+ = 1.9.8 =
163
+ * Allows to disable auto set image Alt/Title.
164
+
165
  = 1.9.7 =
166
  * If jQuery is not found, get that from a CDN.
167
 
411
 
412
  == Upgrade Notice ==
413
 
414
+ = 1.9.8 =
415
+ * Allows to disable auto set image Alt/Title.
416
+
417
  = 1.9.7 =
418
  * If jQuery is not found, get that from a CDN.
419