Image Widget - Version 4.4.7

Version Description

Download this release

Release Info

Developer ggwicz
Plugin Icon 128x128 Image Widget
Version 4.4.7
Comparing to
See all releases

Code changes from version 4.4.6 to 4.4.7

.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ .svn
2
+ .DS_Store
3
+ /.idea/
image-widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Image Widget
4
  Plugin URI: http://wordpress.org/plugins/image-widget/
5
  Description: A simple image widget that uses the native WordPress media manager to add image widgets to your site. <strong><a href="http://m.tri.be/19my">Image Widget Plus</a> - Multiple images, slider and more.</strong>
6
  Author: Modern Tribe, Inc.
7
- Version: 4.4.6
8
  Author URI: http://m.tri.be/iwpdoc
9
  Text Domain: image-widget
10
  Domain Path: /lang
@@ -23,7 +23,7 @@ add_action( 'widgets_init', 'tribe_load_image_widget' );
23
 
24
  class Tribe_Image_Widget extends WP_Widget {
25
 
26
- const VERSION = '4.4.6';
27
 
28
  const CUSTOM_IMAGE_SIZE_SLUG = 'tribe_image_widget_custom';
29
 
@@ -117,6 +117,7 @@ class Tribe_Image_Widget extends WP_Widget {
117
  $instance['description'] = apply_filters( 'widget_text', $instance['description'], $args, $instance );
118
  $instance['link'] = apply_filters( 'image_widget_image_link', esc_url( $instance['link'] ), $args, $instance );
119
  $instance['linkid'] = apply_filters( 'image_widget_image_link_id', esc_attr( $instance['linkid'] ), $args, $instance );
 
120
  $instance['linktarget'] = apply_filters( 'image_widget_image_link_target', esc_attr( $instance['linktarget'] ), $args, $instance );
121
  $instance['width'] = apply_filters( 'image_widget_image_width', abs( $instance['width'] ), $args, $instance );
122
  $instance['height'] = apply_filters( 'image_widget_image_height', abs( $instance['height'] ), $args, $instance );
@@ -173,6 +174,7 @@ class Tribe_Image_Widget extends WP_Widget {
173
  $instance['description'] = apply_filters( 'tribe_image_widget_instance_description', $instance['description'], $new_instance, $old_instance );
174
 
175
  $instance['link'] = $new_instance['link'];
 
176
  $instance['linkid'] = $new_instance['linkid'];
177
  $instance['linktarget'] = $new_instance['linktarget'];
178
  $instance['width'] = abs( $new_instance['width'] );
@@ -228,6 +230,7 @@ class Tribe_Image_Widget extends WP_Widget {
228
  'description' => '',
229
  'link' => '',
230
  'linkid' => '',
 
231
  'linktarget' => '',
232
  'width' => 0,
233
  'height' => 0,
@@ -243,9 +246,15 @@ class Tribe_Image_Widget extends WP_Widget {
243
  if ( ! defined( 'IMAGE_WIDGET_COMPATIBILITY_TEST' ) ) {
244
  $defaults['size'] = self::CUSTOM_IMAGE_SIZE_SLUG;
245
  $defaults['attachment_id'] = 0;
246
- }
247
-
248
- return $defaults;
 
 
 
 
 
 
249
  }
250
 
251
  /**
@@ -271,7 +280,7 @@ class Tribe_Image_Widget extends WP_Widget {
271
  'id' => $instance['linkid'],
272
  'target' => $instance['linktarget'],
273
  'class' => $this->widget_options['classname'] . '-image-link',
274
- 'title' => ( ! empty( $instance['alt'] ) ) ? $instance['alt'] : $instance['title'],
275
  'rel' => $instance['rel'],
276
  );
277
 
4
  Plugin URI: http://wordpress.org/plugins/image-widget/
5
  Description: A simple image widget that uses the native WordPress media manager to add image widgets to your site. <strong><a href="http://m.tri.be/19my">Image Widget Plus</a> - Multiple images, slider and more.</strong>
6
  Author: Modern Tribe, Inc.
7
+ Version: 4.4.7
8
  Author URI: http://m.tri.be/iwpdoc
9
  Text Domain: image-widget
10
  Domain Path: /lang
23
 
24
  class Tribe_Image_Widget extends WP_Widget {
25
 
26
+ const VERSION = '4.4.7';
27
 
28
  const CUSTOM_IMAGE_SIZE_SLUG = 'tribe_image_widget_custom';
29
 
117
  $instance['description'] = apply_filters( 'widget_text', $instance['description'], $args, $instance );
118
  $instance['link'] = apply_filters( 'image_widget_image_link', esc_url( $instance['link'] ), $args, $instance );
119
  $instance['linkid'] = apply_filters( 'image_widget_image_link_id', esc_attr( $instance['linkid'] ), $args, $instance );
120
+ $instance['linktitle'] = apply_filters( 'image_widget_image_link_title', esc_attr( $instance['linktitle'] ), $args, $instance );
121
  $instance['linktarget'] = apply_filters( 'image_widget_image_link_target', esc_attr( $instance['linktarget'] ), $args, $instance );
122
  $instance['width'] = apply_filters( 'image_widget_image_width', abs( $instance['width'] ), $args, $instance );
123
  $instance['height'] = apply_filters( 'image_widget_image_height', abs( $instance['height'] ), $args, $instance );
174
  $instance['description'] = apply_filters( 'tribe_image_widget_instance_description', $instance['description'], $new_instance, $old_instance );
175
 
176
  $instance['link'] = $new_instance['link'];
177
+ $instance['linktitle'] = $new_instance['linktitle'];
178
  $instance['linkid'] = $new_instance['linkid'];
179
  $instance['linktarget'] = $new_instance['linktarget'];
180
  $instance['width'] = abs( $new_instance['width'] );
230
  'description' => '',
231
  'link' => '',
232
  'linkid' => '',
233
+ 'linktitle' => '',
234
  'linktarget' => '',
235
  'width' => 0,
236
  'height' => 0,
246
  if ( ! defined( 'IMAGE_WIDGET_COMPATIBILITY_TEST' ) ) {
247
  $defaults['size'] = self::CUSTOM_IMAGE_SIZE_SLUG;
248
  $defaults['attachment_id'] = 0;
249
+ }
250
+ /**
251
+ * Allow users to customize the default values of various Image Widget options.
252
+ *
253
+ * @since 4.4.7
254
+ *
255
+ * @param array $defaults The array of default option values.
256
+ */
257
+ return apply_filters( 'image_widget_option_defaults', $defaults );
258
  }
259
 
260
  /**
280
  'id' => $instance['linkid'],
281
  'target' => $instance['linktarget'],
282
  'class' => $this->widget_options['classname'] . '-image-link',
283
+ 'title' => ( ! empty( $instance['linktitle'] ) ) ? $instance['linktitle'] : $instance['title'],
284
  'rel' => $instance['rel'],
285
  );
286
 
index.php CHANGED
File without changes
lang/image-widget.pot CHANGED
@@ -2,23 +2,23 @@
2
  # This file is distributed under the same license as the Image Widget package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Image Widget 4.4.3\n"
6
  "Report-Msgid-Bugs-To: http://m.tri.be/191x\n"
7
- "POT-Creation-Date: 2017-05-31 19:18:01+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2017-05-31 19:18\n"
12
  "Last-Translator: \n"
13
  "Language-Team: \n"
14
 
15
- #: image-widget.php:42
16
  msgid "Showcase a single image with a Title, URL, and a Description"
17
  msgstr ""
18
 
19
- #. #-#-#-#-# image-widget.pot (Image Widget 4.4.3) #-#-#-#-#
20
  #. Plugin Name of the plugin/theme
21
- #: image-widget.php:44
22
  msgid "Image Widget"
23
  msgstr ""
24
 
@@ -30,41 +30,41 @@ msgstr ""
30
  msgid "Insert Into Widget"
31
  msgstr ""
32
 
33
- #: image-widget.php:367
34
  msgid "Full Size"
35
  msgstr ""
36
 
37
- #: image-widget.php:368
38
  msgid "Thumbnail"
39
  msgstr ""
40
 
41
- #: image-widget.php:369
42
  msgid "Medium"
43
  msgstr ""
44
 
45
- #: image-widget.php:370
46
  msgid "Large"
47
  msgstr ""
48
 
49
- #: image-widget.php:371
50
  msgid "Custom"
51
  msgstr ""
52
 
53
- #: image-widget.php:515
54
  msgid ""
55
  "<p class=\"dashicons-before dashicons-format-gallery\"><strong>Image Widget "
56
  "Plus</strong> - Add lightbox, slideshow, and random image widgets. "
57
  "<strong><a href=\"%s\" target=\"_blank\">Find out how!</a></strong></p>"
58
  msgstr ""
59
 
60
- #: image-widget.php:532
61
  msgid ""
62
  "<p class=\"dashicons-before dashicons-star-filled\"><strong>Image Widget "
63
  "Plus</strong> - Add lightbox, slideshow, and random image widgets. "
64
  "<strong><a href=\"%s\" target=\"_blank\">Find out how!</a></strong></p>"
65
  msgstr ""
66
 
67
- #: image-widget.php:547
68
  msgid "Image Widget Plus"
69
  msgstr ""
70
 
@@ -92,39 +92,39 @@ msgstr ""
92
  msgid "Link"
93
  msgstr ""
94
 
95
- #: views/widget-admin.deprecated.php:31 views/widget-admin.php:41
96
  msgid "Stay in Window"
97
  msgstr ""
98
 
99
- #: views/widget-admin.deprecated.php:32 views/widget-admin.php:42
100
  msgid "Open New Window"
101
  msgstr ""
102
 
103
- #: views/widget-admin.deprecated.php:35 views/widget-admin.php:61
104
  msgid "Width"
105
  msgstr ""
106
 
107
- #: views/widget-admin.deprecated.php:38 views/widget-admin.php:64
108
  msgid "Height"
109
  msgstr ""
110
 
111
- #: views/widget-admin.deprecated.php:41 views/widget-admin.php:69
112
  msgid "Align"
113
  msgstr ""
114
 
115
- #: views/widget-admin.deprecated.php:43 views/widget-admin.php:71
116
  msgid "none"
117
  msgstr ""
118
 
119
- #: views/widget-admin.deprecated.php:44 views/widget-admin.php:72
120
  msgid "left"
121
  msgstr ""
122
 
123
- #: views/widget-admin.deprecated.php:45 views/widget-admin.php:73
124
  msgid "center"
125
  msgstr ""
126
 
127
- #: views/widget-admin.deprecated.php:46 views/widget-admin.php:74
128
  msgid "right"
129
  msgstr ""
130
 
@@ -144,10 +144,14 @@ msgid ""
144
  msgstr ""
145
 
146
  #: views/widget-admin.php:38
 
 
 
 
147
  msgid "Link ID"
148
  msgstr ""
149
 
150
- #: views/widget-admin.php:49
151
  msgid "Size"
152
  msgstr ""
153
 
2
  # This file is distributed under the same license as the Image Widget package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Image Widget 4.4.6\n"
6
  "Report-Msgid-Bugs-To: http://m.tri.be/191x\n"
7
+ "POT-Creation-Date: 2017-11-01 13:22:47+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2017-11-01 13:22\n"
12
  "Last-Translator: \n"
13
  "Language-Team: \n"
14
 
15
+ #: image-widget.php:38
16
  msgid "Showcase a single image with a Title, URL, and a Description"
17
  msgstr ""
18
 
19
+ #. #-#-#-#-# image-widget.pot (Image Widget 4.4.6) #-#-#-#-#
20
  #. Plugin Name of the plugin/theme
21
+ #: image-widget.php:41
22
  msgid "Image Widget"
23
  msgstr ""
24
 
30
  msgid "Insert Into Widget"
31
  msgstr ""
32
 
33
+ #: image-widget.php:412
34
  msgid "Full Size"
35
  msgstr ""
36
 
37
+ #: image-widget.php:413
38
  msgid "Thumbnail"
39
  msgstr ""
40
 
41
+ #: image-widget.php:414
42
  msgid "Medium"
43
  msgstr ""
44
 
45
+ #: image-widget.php:415
46
  msgid "Large"
47
  msgstr ""
48
 
49
+ #: image-widget.php:416
50
  msgid "Custom"
51
  msgstr ""
52
 
53
+ #: image-widget.php:575
54
  msgid ""
55
  "<p class=\"dashicons-before dashicons-format-gallery\"><strong>Image Widget "
56
  "Plus</strong> - Add lightbox, slideshow, and random image widgets. "
57
  "<strong><a href=\"%s\" target=\"_blank\">Find out how!</a></strong></p>"
58
  msgstr ""
59
 
60
+ #: image-widget.php:597
61
  msgid ""
62
  "<p class=\"dashicons-before dashicons-star-filled\"><strong>Image Widget "
63
  "Plus</strong> - Add lightbox, slideshow, and random image widgets. "
64
  "<strong><a href=\"%s\" target=\"_blank\">Find out how!</a></strong></p>"
65
  msgstr ""
66
 
67
+ #: image-widget.php:613
68
  msgid "Image Widget Plus"
69
  msgstr ""
70
 
92
  msgid "Link"
93
  msgstr ""
94
 
95
+ #: views/widget-admin.deprecated.php:31 views/widget-admin.php:43
96
  msgid "Stay in Window"
97
  msgstr ""
98
 
99
+ #: views/widget-admin.deprecated.php:32 views/widget-admin.php:44
100
  msgid "Open New Window"
101
  msgstr ""
102
 
103
+ #: views/widget-admin.deprecated.php:35 views/widget-admin.php:63
104
  msgid "Width"
105
  msgstr ""
106
 
107
+ #: views/widget-admin.deprecated.php:38 views/widget-admin.php:66
108
  msgid "Height"
109
  msgstr ""
110
 
111
+ #: views/widget-admin.deprecated.php:41 views/widget-admin.php:71
112
  msgid "Align"
113
  msgstr ""
114
 
115
+ #: views/widget-admin.deprecated.php:43 views/widget-admin.php:73
116
  msgid "none"
117
  msgstr ""
118
 
119
+ #: views/widget-admin.deprecated.php:44 views/widget-admin.php:74
120
  msgid "left"
121
  msgstr ""
122
 
123
+ #: views/widget-admin.deprecated.php:45 views/widget-admin.php:75
124
  msgid "center"
125
  msgstr ""
126
 
127
+ #: views/widget-admin.deprecated.php:46 views/widget-admin.php:76
128
  msgid "right"
129
  msgstr ""
130
 
144
  msgstr ""
145
 
146
  #: views/widget-admin.php:38
147
+ msgid "Link Title"
148
+ msgstr ""
149
+
150
+ #: views/widget-admin.php:40
151
  msgid "Link ID"
152
  msgstr ""
153
 
154
+ #: views/widget-admin.php:51
155
  msgid "Size"
156
  msgstr ""
157
 
lib/ImageWidgetDeprecated.php CHANGED
File without changes
lib/index.php CHANGED
File without changes
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ModernTribe, aguseo, borkweb, barry.hughes, bordoni, brianjessee,
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4BSPTNFFY6AL6
4
  Tags: widget, image, ad, banner, simple, upload, sidebar, retina, admin, thickbox, resize, arabic, brazilian portuguese, dutch, german, hebrew, italian, japanese, polish, spanish, swedish, widget-only
5
  Requires at least: 3.5
6
- Tested up to: 4.8
7
- Stable tag: 4.4.6
8
 
9
  A simple image widget that uses the native WordPress media manager to add image widgets to your site.
10
 
@@ -206,6 +206,11 @@ For more info on the philosophy here, check out our [blog post](http://tri.be/de
206
 
207
  == Changelog ==
208
 
 
 
 
 
 
209
  = [4.4.6] 2017-09-12 =
210
 
211
  * New - Added new filter `tribe_image_widget_instance_description` for more control over how the description field is handled.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4BSPTNFFY6AL6
4
  Tags: widget, image, ad, banner, simple, upload, sidebar, retina, admin, thickbox, resize, arabic, brazilian portuguese, dutch, german, hebrew, italian, japanese, polish, spanish, swedish, widget-only
5
  Requires at least: 3.5
6
+ Tested up to: 4.8.3
7
+ Stable tag: 4.4.7
8
 
9
  A simple image widget that uses the native WordPress media manager to add image widgets to your site.
10
 
206
 
207
  == Changelog ==
208
 
209
+ = [4.4.7] 2017-11-02 =
210
+
211
+ * Feature - Added new Link Title field and filter to improve tooltip (previously used alt text) (thanks @marklcm) [89993]
212
+ * Tweak - Added new `image_widget_option_defaults` hook to improve customizability (props @svandragt) [#91225]
213
+
214
  = [4.4.6] 2017-09-12 =
215
 
216
  * New - Added new filter `tribe_image_widget_instance_description` for more control over how the description field is handled.
resources/css/admin.css CHANGED
File without changes
resources/index.php CHANGED
File without changes
resources/js/image-widget.deprecated.js CHANGED
File without changes
resources/js/image-widget.deprecated.upload-fixer.js CHANGED
File without changes
resources/js/image-widget.js CHANGED
File without changes
resources/js/index.php CHANGED
File without changes
views/index.php CHANGED
File without changes
views/widget-admin.deprecated.php CHANGED
File without changes
views/widget-admin.php CHANGED
@@ -35,6 +35,8 @@ $id_prefix = $this->get_field_id( '' );
35
 
36
  <p><label for="<?php echo $this->get_field_id( 'link' ); ?>"><?php _e( 'Link', 'image-widget' ); ?>:</label>
37
  <input class="widefat" id="<?php echo $this->get_field_id( 'link' ); ?>" name="<?php echo $this->get_field_name( 'link' ); ?>" type="text" value="<?php echo esc_attr( strip_tags( $instance['link'] ) ); ?>" /><br />
 
 
38
  <label for="<?php echo $this->get_field_id( 'linkid' ); ?>"><?php _e( 'Link ID', 'image-widget' ); ?>:</label>
39
  <input class="widefat" id="<?php echo $this->get_field_id( 'linkid' ); ?>" name="<?php echo $this->get_field_name( 'linkid' ); ?>" type="text" value="<?php echo esc_attr( strip_tags( $instance['linkid'] ) ); ?>" /><br />
40
  <select name="<?php echo $this->get_field_name( 'linktarget' ); ?>" id="<?php echo $this->get_field_id( 'linktarget' ); ?>">
35
 
36
  <p><label for="<?php echo $this->get_field_id( 'link' ); ?>"><?php _e( 'Link', 'image-widget' ); ?>:</label>
37
  <input class="widefat" id="<?php echo $this->get_field_id( 'link' ); ?>" name="<?php echo $this->get_field_name( 'link' ); ?>" type="text" value="<?php echo esc_attr( strip_tags( $instance['link'] ) ); ?>" /><br />
38
+ <p><label for="<?php echo $this->get_field_id( 'linktitle' ); ?>"><?php _e( 'Link Title', 'image-widget' ); ?>:</label>
39
+ <input class="widefat" id="<?php echo $this->get_field_id( 'linktitle' ); ?>" name="<?php echo $this->get_field_name( 'linktitle' ); ?>" type="text" value="<?php echo esc_attr( strip_tags( $instance['linktitle'] ) ); ?>" /><br />
40
  <label for="<?php echo $this->get_field_id( 'linkid' ); ?>"><?php _e( 'Link ID', 'image-widget' ); ?>:</label>
41
  <input class="widefat" id="<?php echo $this->get_field_id( 'linkid' ); ?>" name="<?php echo $this->get_field_name( 'linkid' ); ?>" type="text" value="<?php echo esc_attr( strip_tags( $instance['linkid'] ) ); ?>" /><br />
42
  <select name="<?php echo $this->get_field_name( 'linktarget' ); ?>" id="<?php echo $this->get_field_id( 'linktarget' ); ?>">
views/widget.php CHANGED
File without changes