Version Description
- Tweak - Retiring the use of PHP 4 style constructors
Download this release
Release Info
Developer | borkweb |
Plugin | Image Widget |
Version | 4.1.1 |
Comparing to | |
See all releases |
Code changes from version 4.1 to 4.1.1
- image-widget.php +12 -10
- readme.txt +6 -2
image-widget.php
CHANGED
@@ -9,8 +9,9 @@ Author URI: http://m.tri.be/26
|
|
9 |
*/
|
10 |
|
11 |
// Block direct requests
|
12 |
-
if ( !defined('ABSPATH') )
|
13 |
die('-1');
|
|
|
14 |
|
15 |
// Load the widget on widgets_init
|
16 |
function tribe_load_image_widget() {
|
@@ -23,7 +24,7 @@ add_action('widgets_init', 'tribe_load_image_widget');
|
|
23 |
**/
|
24 |
class Tribe_Image_Widget extends WP_Widget {
|
25 |
|
26 |
-
const VERSION = '4.1';
|
27 |
|
28 |
const CUSTOM_IMAGE_SIZE_SLUG = 'tribe_image_widget_custom';
|
29 |
|
@@ -32,11 +33,12 @@ class Tribe_Image_Widget extends WP_Widget {
|
|
32 |
*
|
33 |
* @author Modern Tribe, Inc.
|
34 |
*/
|
35 |
-
function
|
36 |
load_plugin_textdomain( 'image_widget', false, trailingslashit(basename(dirname(__FILE__))) . 'lang/');
|
37 |
$widget_ops = array( 'classname' => 'widget_sp_image', 'description' => __( 'Showcase a single image with a Title, URL, and a Description', 'image_widget' ) );
|
38 |
$control_ops = array( 'id_base' => 'widget_sp_image' );
|
39 |
-
|
|
|
40 |
if ( $this->use_old_uploader() ) {
|
41 |
require_once( 'lib/ImageWidgetDeprecated.php' );
|
42 |
new ImageWidgetDeprecated( $this );
|
@@ -65,7 +67,7 @@ class Tribe_Image_Widget extends WP_Widget {
|
|
65 |
/**
|
66 |
* Enqueue all the javascript.
|
67 |
*/
|
68 |
-
function admin_setup() {
|
69 |
wp_enqueue_media();
|
70 |
wp_enqueue_script( 'tribe-image-widget', plugins_url('resources/js/image-widget.js', __FILE__), array( 'jquery', 'media-upload', 'media-views' ), self::VERSION );
|
71 |
|
@@ -82,7 +84,7 @@ class Tribe_Image_Widget extends WP_Widget {
|
|
82 |
* @param array $instance
|
83 |
* @author Modern Tribe, Inc.
|
84 |
*/
|
85 |
-
function widget( $args, $instance ) {
|
86 |
extract( $args );
|
87 |
$instance = wp_parse_args( (array) $instance, self::get_defaults() );
|
88 |
if ( !empty( $instance['imageurl'] ) || !empty( $instance['attachment_id'] ) ) {
|
@@ -120,7 +122,7 @@ class Tribe_Image_Widget extends WP_Widget {
|
|
120 |
* @return object
|
121 |
* @author Modern Tribe, Inc.
|
122 |
*/
|
123 |
-
function update( $new_instance, $old_instance ) {
|
124 |
$instance = $old_instance;
|
125 |
$new_instance = wp_parse_args( (array) $new_instance, self::get_defaults() );
|
126 |
$instance['title'] = strip_tags($new_instance['title']);
|
@@ -161,7 +163,7 @@ class Tribe_Image_Widget extends WP_Widget {
|
|
161 |
* @param object $instance Widget Instance
|
162 |
* @author Modern Tribe, Inc.
|
163 |
*/
|
164 |
-
function form( $instance ) {
|
165 |
$instance = wp_parse_args( (array) $instance, self::get_defaults() );
|
166 |
if ( $this->use_old_uploader() ) {
|
167 |
include( $this->getTemplateHierarchy( 'widget-admin.deprecated' ) );
|
@@ -175,7 +177,7 @@ class Tribe_Image_Widget extends WP_Widget {
|
|
175 |
*
|
176 |
* @author Modern Tribe, Inc.
|
177 |
*/
|
178 |
-
function admin_head() {
|
179 |
?>
|
180 |
<style type="text/css">
|
181 |
.uploader input.button {
|
@@ -368,7 +370,7 @@ class Tribe_Image_Widget extends WP_Widget {
|
|
368 |
* @author Modern Tribe, Inc. (Matt Wiebe)
|
369 |
**/
|
370 |
|
371 |
-
function getTemplateHierarchy($template) {
|
372 |
// whether or not .php was added
|
373 |
$template_slug = rtrim($template, '.php');
|
374 |
$template = $template_slug . '.php';
|
9 |
*/
|
10 |
|
11 |
// Block direct requests
|
12 |
+
if ( !defined('ABSPATH') ) {
|
13 |
die('-1');
|
14 |
+
}
|
15 |
|
16 |
// Load the widget on widgets_init
|
17 |
function 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 |
|
33 |
*
|
34 |
* @author Modern Tribe, Inc.
|
35 |
*/
|
36 |
+
public function __construct() {
|
37 |
load_plugin_textdomain( 'image_widget', false, trailingslashit(basename(dirname(__FILE__))) . 'lang/');
|
38 |
$widget_ops = array( 'classname' => 'widget_sp_image', 'description' => __( 'Showcase a single image with a Title, URL, and a Description', 'image_widget' ) );
|
39 |
$control_ops = array( 'id_base' => 'widget_sp_image' );
|
40 |
+
parent::__construct('widget_sp_image', __('Image Widget', 'image_widget'), $widget_ops, $control_ops);
|
41 |
+
|
42 |
if ( $this->use_old_uploader() ) {
|
43 |
require_once( 'lib/ImageWidgetDeprecated.php' );
|
44 |
new ImageWidgetDeprecated( $this );
|
67 |
/**
|
68 |
* Enqueue all the javascript.
|
69 |
*/
|
70 |
+
public function admin_setup() {
|
71 |
wp_enqueue_media();
|
72 |
wp_enqueue_script( 'tribe-image-widget', plugins_url('resources/js/image-widget.js', __FILE__), array( 'jquery', 'media-upload', 'media-views' ), self::VERSION );
|
73 |
|
84 |
* @param array $instance
|
85 |
* @author Modern Tribe, Inc.
|
86 |
*/
|
87 |
+
public function widget( $args, $instance ) {
|
88 |
extract( $args );
|
89 |
$instance = wp_parse_args( (array) $instance, self::get_defaults() );
|
90 |
if ( !empty( $instance['imageurl'] ) || !empty( $instance['attachment_id'] ) ) {
|
122 |
* @return object
|
123 |
* @author Modern Tribe, Inc.
|
124 |
*/
|
125 |
+
public function update( $new_instance, $old_instance ) {
|
126 |
$instance = $old_instance;
|
127 |
$new_instance = wp_parse_args( (array) $new_instance, self::get_defaults() );
|
128 |
$instance['title'] = strip_tags($new_instance['title']);
|
163 |
* @param object $instance Widget Instance
|
164 |
* @author Modern Tribe, Inc.
|
165 |
*/
|
166 |
+
public function form( $instance ) {
|
167 |
$instance = wp_parse_args( (array) $instance, self::get_defaults() );
|
168 |
if ( $this->use_old_uploader() ) {
|
169 |
include( $this->getTemplateHierarchy( 'widget-admin.deprecated' ) );
|
177 |
*
|
178 |
* @author Modern Tribe, Inc.
|
179 |
*/
|
180 |
+
public function admin_head() {
|
181 |
?>
|
182 |
<style type="text/css">
|
183 |
.uploader input.button {
|
370 |
* @author Modern Tribe, Inc. (Matt Wiebe)
|
371 |
**/
|
372 |
|
373 |
+
public function getTemplateHierarchy($template) {
|
374 |
// whether or not .php was added
|
375 |
$template_slug = rtrim($template, '.php');
|
376 |
$template = $template_slug . '.php';
|
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
|
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 =
|
177 |
|
178 |
* Remove accidentally deployed image size update.
|
@@ -452,4 +456,4 @@ http://wordpress.org/support/topic/image-widget-40-translations-needed-2
|
|
452 |
|
453 |
= Where do I go to file a bug or ask a question? =
|
454 |
|
455 |
-
Please visit the forum for questions or comments: http://wordpress.org/tags/image-widget/
|
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 |
|
174 |
== Changelog ==
|
175 |
|
176 |
+
= 4.1.1 =
|
177 |
+
|
178 |
+
* Tweak - Retiring the use of PHP 4 style constructors
|
179 |
+
|
180 |
= 4.1 =
|
181 |
|
182 |
* Remove accidentally deployed image size update.
|
456 |
|
457 |
= Where do I go to file a bug or ask a question? =
|
458 |
|
459 |
+
Please visit the forum for questions or comments: http://wordpress.org/tags/image-widget/
|