Version Description
Download this release
Release Info
Developer | peterchester |
Plugin | Image Widget |
Version | 3.0.1 |
Comparing to | |
See all releases |
Code changes from version 3.0 to 3.0.1
- image-widget.php +12 -12
- readme.txt +9 -5
image-widget.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Image Widget
|
|
4 |
Plugin URI: http://www.shaneandpeter.com/wordpress
|
5 |
Description: This widget accepts a title, an image, a link and a description and displays them.
|
6 |
Author: Shane and Peter, Inc.
|
7 |
-
Version: 3.0
|
8 |
Author URI: http://www.shaneandpeter.com
|
9 |
*/
|
10 |
|
@@ -23,9 +23,9 @@ add_action('widgets_init', 'load_sp_image_widget');
|
|
23 |
class SP_Image_Widget extends WP_Widget {
|
24 |
|
25 |
function SP_Image_Widget() {
|
26 |
-
$widget_ops = array( 'classname' => 'widget_sp_image', 'description' => __( 'Showcase a single image with a Title, URL, and a Description' ) );
|
27 |
$control_ops = array( 'id_base' => 'widget_sp_image' );
|
28 |
-
$this->WP_Widget('widget_sp_image', __('Image Widget'), $widget_ops, $control_ops);
|
29 |
|
30 |
if (WP_ADMIN) {
|
31 |
wp_enqueue_script( 'thickbox' );
|
@@ -128,14 +128,14 @@ class SP_Image_Widget extends WP_Widget {
|
|
128 |
) );
|
129 |
?>
|
130 |
|
131 |
-
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
|
132 |
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['title'])); ?>" /></p>
|
133 |
|
134 |
-
<p><label for="<?php echo $this->get_field_id('image'); ?>"><?php _e('Image:'); ?></label>
|
135 |
<?php
|
136 |
$media_upload_iframe_src = "media-upload.php?type=image&widget_id=".$this->id; //NOTE #1: the widget id is added here to allow uploader to only return array if this is used with image widget so that all other uploads are not harmed.
|
137 |
$image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src");
|
138 |
-
$image_title = __('Add an Image');
|
139 |
?><br />
|
140 |
<a href="<?php echo $image_upload_iframe_src; ?>&TB_iframe=true" id="add_image-<?php echo $this->get_field_id('image'); ?>" class="thickbox" title='<?php echo $image_title; ?>' onClick="set_active_widget('<?php echo $this->get_field_id('image'); ?>','<?php echo $this->get_field_id('width'); ?>','<?php echo $this->get_field_id('height'); ?>');return false;"><img src='images/media-button-image.gif' alt='<?php echo $image_title; ?>' /> <?php echo $image_title; ?></a>
|
141 |
<div id="display-<?php echo $this->get_field_id('image'); ?>"><?php
|
@@ -144,20 +144,20 @@ class SP_Image_Widget extends WP_Widget {
|
|
144 |
<input id="<?php echo $this->get_field_id('image'); ?>" name="<?php echo $this->get_field_name('image'); ?>" type="hidden" value="<?php echo $instance['image']; ?>" />
|
145 |
</p>
|
146 |
|
147 |
-
<p><label for="<?php echo $this->get_field_id('description'); ?>"><?php _e('Description:'); ?></label>
|
148 |
<textarea rows="8" class="widefat" id="<?php echo $this->get_field_id('description'); ?>" name="<?php echo $this->get_field_name('description'); ?>"><?php echo format_to_edit($instance['description']); ?></textarea></p>
|
149 |
|
150 |
-
<p><label for="<?php echo $this->get_field_id('link'); ?>"><?php _e('Link:'); ?></label>
|
151 |
<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 />
|
152 |
<select name="<?php echo $this->get_field_name('linktarget'); ?>" id="<?php echo $this->get_field_id('linktarget'); ?>">
|
153 |
-
<option value="_self"<?php selected( $instance['linktarget'], '_self' ); ?>><?php _e('Stay in Window'); ?></option>
|
154 |
-
<option value="_blank"<?php selected( $instance['linktarget'], '_blank' ); ?>><?php _e('Open New Window'); ?></option>
|
155 |
</select></p>
|
156 |
|
157 |
-
<p><label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width:'); ?></label>
|
158 |
<input id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['width'])); ?>" /></p>
|
159 |
|
160 |
-
<p><label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height:'); ?></label>
|
161 |
<input id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['height'])); ?>" /></p>
|
162 |
|
163 |
<?php
|
4 |
Plugin URI: http://www.shaneandpeter.com/wordpress
|
5 |
Description: This widget accepts a title, an image, a link and a description and displays them.
|
6 |
Author: Shane and Peter, Inc.
|
7 |
+
Version: 3.0.1
|
8 |
Author URI: http://www.shaneandpeter.com
|
9 |
*/
|
10 |
|
23 |
class SP_Image_Widget extends WP_Widget {
|
24 |
|
25 |
function SP_Image_Widget() {
|
26 |
+
$widget_ops = array( 'classname' => 'widget_sp_image', 'description' => __( 'Showcase a single image with a Title, URL, and a Description', 'sp_image_widget' ) );
|
27 |
$control_ops = array( 'id_base' => 'widget_sp_image' );
|
28 |
+
$this->WP_Widget('widget_sp_image', __('Image Widget', 'sp_image_widget'), $widget_ops, $control_ops);
|
29 |
|
30 |
if (WP_ADMIN) {
|
31 |
wp_enqueue_script( 'thickbox' );
|
128 |
) );
|
129 |
?>
|
130 |
|
131 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'sp_image_widget'); ?></label>
|
132 |
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['title'])); ?>" /></p>
|
133 |
|
134 |
+
<p><label for="<?php echo $this->get_field_id('image'); ?>"><?php _e('Image:', 'sp_image_widget'); ?></label>
|
135 |
<?php
|
136 |
$media_upload_iframe_src = "media-upload.php?type=image&widget_id=".$this->id; //NOTE #1: the widget id is added here to allow uploader to only return array if this is used with image widget so that all other uploads are not harmed.
|
137 |
$image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src");
|
138 |
+
$image_title = __('Add an Image', 'sp_image_widget');
|
139 |
?><br />
|
140 |
<a href="<?php echo $image_upload_iframe_src; ?>&TB_iframe=true" id="add_image-<?php echo $this->get_field_id('image'); ?>" class="thickbox" title='<?php echo $image_title; ?>' onClick="set_active_widget('<?php echo $this->get_field_id('image'); ?>','<?php echo $this->get_field_id('width'); ?>','<?php echo $this->get_field_id('height'); ?>');return false;"><img src='images/media-button-image.gif' alt='<?php echo $image_title; ?>' /> <?php echo $image_title; ?></a>
|
141 |
<div id="display-<?php echo $this->get_field_id('image'); ?>"><?php
|
144 |
<input id="<?php echo $this->get_field_id('image'); ?>" name="<?php echo $this->get_field_name('image'); ?>" type="hidden" value="<?php echo $instance['image']; ?>" />
|
145 |
</p>
|
146 |
|
147 |
+
<p><label for="<?php echo $this->get_field_id('description'); ?>"><?php _e('Description:', 'sp_image_widget'); ?></label>
|
148 |
<textarea rows="8" class="widefat" id="<?php echo $this->get_field_id('description'); ?>" name="<?php echo $this->get_field_name('description'); ?>"><?php echo format_to_edit($instance['description']); ?></textarea></p>
|
149 |
|
150 |
+
<p><label for="<?php echo $this->get_field_id('link'); ?>"><?php _e('Link:', 'sp_image_widget'); ?></label>
|
151 |
<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 />
|
152 |
<select name="<?php echo $this->get_field_name('linktarget'); ?>" id="<?php echo $this->get_field_id('linktarget'); ?>">
|
153 |
+
<option value="_self"<?php selected( $instance['linktarget'], '_self' ); ?>><?php _e('Stay in Window', 'sp_image_widget'); ?></option>
|
154 |
+
<option value="_blank"<?php selected( $instance['linktarget'], '_blank' ); ?>><?php _e('Open New Window', 'sp_image_widget'); ?></option>
|
155 |
</select></p>
|
156 |
|
157 |
+
<p><label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width:', 'sp_image_widget'); ?></label>
|
158 |
<input id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['width'])); ?>" /></p>
|
159 |
|
160 |
+
<p><label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height:', 'sp_image_widget'); ?></label>
|
161 |
<input id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr(strip_tags($instance['height'])); ?>" /></p>
|
162 |
|
163 |
<?php
|
readme.txt
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
=== Image Widget ===
|
2 |
Contributors: Shane & Peter, Inc.
|
3 |
Donate link: http://www.shaneandpeter.com
|
4 |
-
Tags: widget, image, ad, banner, simple
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 2.8.4
|
7 |
-
Stable tag: 3.0
|
8 |
|
9 |
-
Simple image widget.
|
10 |
|
11 |
== Description ==
|
12 |
-
Simple image widget.
|
13 |
|
14 |
Todo:
|
15 |
-
* Add an image breaks after save is clicked
|
16 |
|
17 |
== Installation ==
|
18 |
|
@@ -32,6 +32,10 @@ If you find any bugs or have any ideas, please mail us.
|
|
32 |
|
33 |
== Changelog ==
|
34 |
|
|
|
|
|
|
|
|
|
35 |
New in version 3.0
|
36 |
|
37 |
* Completely remodeled the plugin to use the native wordpress uploader and be compatible with Wordpress 2.8 plugin architecture.
|
1 |
=== Image Widget ===
|
2 |
Contributors: Shane & Peter, Inc.
|
3 |
Donate link: http://www.shaneandpeter.com
|
4 |
+
Tags: widget, image, ad, banner, simple, upload, sidebar
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 2.8.4
|
7 |
+
Stable tag: 3.0.1
|
8 |
|
9 |
+
Simple image widget. Use native Wordpress upload thickbox to add image widgets to your site.
|
10 |
|
11 |
== Description ==
|
12 |
+
Simple image widget. Use native Wordpress upload thickbox to add image widgets to your site.
|
13 |
|
14 |
Todo:
|
15 |
+
* 'Add an image' breaks after save is clicked
|
16 |
|
17 |
== Installation ==
|
18 |
|
32 |
|
33 |
== Changelog ==
|
34 |
|
35 |
+
New in version 3.0.1
|
36 |
+
|
37 |
+
* Added 'sp_image_widget' domain for language support.
|
38 |
+
|
39 |
New in version 3.0
|
40 |
|
41 |
* Completely remodeled the plugin to use the native wordpress uploader and be compatible with Wordpress 2.8 plugin architecture.
|