Image Widget - Version 4.1.2

Version Description

  • Tweak - Added support for an id attribute on links (Props to amyh for the work on this!)
Download this release

Release Info

Developer borkweb
Plugin Icon 128x128 Image Widget
Version 4.1.2
Comparing to
See all releases

Code changes from version 4.1.1 to 4.1.2

Files changed (3) hide show
  1. image-widget.php +6 -2
  2. readme.txt +5 -1
  3. views/widget-admin.php +2 -0
image-widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Image Widget
4
  Plugin URI: http://wordpress.org/extend/plugins/image-widget/
5
  Description: A simple image widget that uses the native WordPress media manager to add image widgets to your site.
6
  Author: Modern Tribe, Inc.
7
- Version: 4.1
8
  Author URI: http://m.tri.be/26
9
  */
10
 
@@ -24,7 +24,7 @@ add_action('widgets_init', 'tribe_load_image_widget');
24
  **/
25
  class Tribe_Image_Widget extends WP_Widget {
26
 
27
- const VERSION = '4.1.1';
28
 
29
  const CUSTOM_IMAGE_SIZE_SLUG = 'tribe_image_widget_custom';
30
 
@@ -92,6 +92,7 @@ class Tribe_Image_Widget extends WP_Widget {
92
  $instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'] );
93
  $instance['description'] = apply_filters( 'widget_text', $instance['description'], $args, $instance );
94
  $instance['link'] = apply_filters( 'image_widget_image_link', esc_url( $instance['link'] ), $args, $instance );
 
95
  $instance['linktarget'] = apply_filters( 'image_widget_image_link_target', esc_attr( $instance['linktarget'] ), $args, $instance );
96
  $instance['width'] = apply_filters( 'image_widget_image_width', abs( $instance['width'] ), $args, $instance );
97
  $instance['height'] = apply_filters( 'image_widget_image_height', abs( $instance['height'] ), $args, $instance );
@@ -132,6 +133,7 @@ class Tribe_Image_Widget extends WP_Widget {
132
  $instance['description'] = wp_filter_post_kses($new_instance['description']);
133
  }
134
  $instance['link'] = $new_instance['link'];
 
135
  $instance['linktarget'] = $new_instance['linktarget'];
136
  $instance['width'] = abs( $new_instance['width'] );
137
  $instance['height'] =abs( $new_instance['height'] );
@@ -214,6 +216,7 @@ class Tribe_Image_Widget extends WP_Widget {
214
  'title' => '',
215
  'description' => '',
216
  'link' => '',
 
217
  'linktarget' => '',
218
  'width' => 0,
219
  'height' => 0,
@@ -252,6 +255,7 @@ class Tribe_Image_Widget extends WP_Widget {
252
  if ( $include_link && !empty( $instance['link'] ) ) {
253
  $attr = array(
254
  'href' => $instance['link'],
 
255
  'target' => $instance['linktarget'],
256
  'class' => $this->widget_options['classname'].'-image-link',
257
  'title' => ( !empty( $instance['alt'] ) ) ? $instance['alt'] : $instance['title'],
4
  Plugin URI: http://wordpress.org/extend/plugins/image-widget/
5
  Description: A simple image widget that uses the native WordPress media manager to add image widgets to your site.
6
  Author: Modern Tribe, Inc.
7
+ Version: 4.1.2
8
  Author URI: http://m.tri.be/26
9
  */
10
 
24
  **/
25
  class Tribe_Image_Widget extends WP_Widget {
26
 
27
+ const VERSION = '4.1.2';
28
 
29
  const CUSTOM_IMAGE_SIZE_SLUG = 'tribe_image_widget_custom';
30
 
92
  $instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'] );
93
  $instance['description'] = apply_filters( 'widget_text', $instance['description'], $args, $instance );
94
  $instance['link'] = apply_filters( 'image_widget_image_link', esc_url( $instance['link'] ), $args, $instance );
95
+ $instance['linkid'] = apply_filters( 'image_widget_image_link_id', esc_attr( $instance['linkid'] ), $args, $instance );
96
  $instance['linktarget'] = apply_filters( 'image_widget_image_link_target', esc_attr( $instance['linktarget'] ), $args, $instance );
97
  $instance['width'] = apply_filters( 'image_widget_image_width', abs( $instance['width'] ), $args, $instance );
98
  $instance['height'] = apply_filters( 'image_widget_image_height', abs( $instance['height'] ), $args, $instance );
133
  $instance['description'] = wp_filter_post_kses($new_instance['description']);
134
  }
135
  $instance['link'] = $new_instance['link'];
136
+ $instance['linkid'] = $new_instance['linkid'];
137
  $instance['linktarget'] = $new_instance['linktarget'];
138
  $instance['width'] = abs( $new_instance['width'] );
139
  $instance['height'] =abs( $new_instance['height'] );
216
  'title' => '',
217
  'description' => '',
218
  'link' => '',
219
+ 'linkid' => '',
220
  'linktarget' => '',
221
  'width' => 0,
222
  'height' => 0,
255
  if ( $include_link && !empty( $instance['link'] ) ) {
256
  $attr = array(
257
  'href' => $instance['link'],
258
+ 'id' => $instance['linkid'],
259
  'target' => $instance['linktarget'],
260
  'class' => $this->widget_options['classname'].'-image-link',
261
  'title' => ( !empty( $instance['alt'] ) ) ? $instance['alt'] : $instance['title'],
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: widget, image, ad, banner, simple, upload, sidebar, 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: 3.9
7
- Stable tag: 4.1.1
8
 
9
  == Description ==
10
 
@@ -173,6 +173,10 @@ For more info on the philosophy here, check out our blog post: http://tri.be/def
173
 
174
  == Changelog ==
175
 
 
 
 
 
176
  = 4.1.1 =
177
 
178
  * Tweak - Retiring the use of PHP 4 style constructors
4
  Tags: widget, image, ad, banner, simple, upload, sidebar, 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: 3.9
7
+ Stable tag: 4.1.2
8
 
9
  == Description ==
10
 
173
 
174
  == Changelog ==
175
 
176
+ = 4.1.2 =
177
+
178
+ * Tweak - Added support for an id attribute on links (Props to amyh for the work on this!)
179
+
180
  = 4.1.1 =
181
 
182
  * Tweak - Retiring the use of PHP 4 style constructors
views/widget-admin.php CHANGED
@@ -31,6 +31,8 @@ if ( !defined('ABSPATH') )
31
 
32
  <p><label for="<?php echo $this->get_field_id('link'); ?>"><?php _e('Link', 'image_widget'); ?>:</label>
33
  <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 />
 
 
34
  <select name="<?php echo $this->get_field_name('linktarget'); ?>" id="<?php echo $this->get_field_id('linktarget'); ?>">
35
  <option value="_self"<?php selected( $instance['linktarget'], '_self' ); ?>><?php _e('Stay in Window', 'image_widget'); ?></option>
36
  <option value="_blank"<?php selected( $instance['linktarget'], '_blank' ); ?>><?php _e('Open New Window', 'image_widget'); ?></option>
31
 
32
  <p><label for="<?php echo $this->get_field_id('link'); ?>"><?php _e('Link', 'image_widget'); ?>:</label>
33
  <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 />
34
+ <label for="<?php echo $this->get_field_id('linkid'); ?>"><?php _e('Link ID', 'image_widget'); ?>:</label>
35
+ <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 />
36
  <select name="<?php echo $this->get_field_name('linktarget'); ?>" id="<?php echo $this->get_field_id('linktarget'); ?>">
37
  <option value="_self"<?php selected( $instance['linktarget'], '_self' ); ?>><?php _e('Stay in Window', 'image_widget'); ?></option>
38
  <option value="_blank"<?php selected( $instance['linktarget'], '_blank' ); ?>><?php _e('Open New Window', 'image_widget'); ?></option>