Enhanced Text Widget - Version 1.3.2

Version Description

  • Bug fixes
Download this release

Release Info

Developer bostondv
Plugin Icon wp plugin Enhanced Text Widget
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3.1 to 1.3.2

Files changed (2) hide show
  1. enhanced-text-widget.php +10 -5
  2. readme.txt +4 -1
enhanced-text-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Enhanced Text Widget
4
  Plugin URI: http://pomelodesign.com/enhanced-text-widget
5
  Description: An enhanced version of the default text widget where you may have Text, HTML, CSS, JavaScript, Flash, and/or PHP as content with linkable widget title.
6
- Version: 1.3.1
7
  Author: Pomelo Design
8
  Author URI: http://pomelodesign.com/
9
  License: GPL2
@@ -37,6 +37,7 @@ class EnhancedTextWidget extends WP_Widget {
37
  $titleUrl = apply_filters('widget_title', empty($instance['titleUrl']) ? '' : $instance['titleUrl'], $instance);
38
  $newWindow = $instance['newWindow'] ? '1' : '0';
39
  $cssClass = apply_filters('widget_title', empty($instance['cssClass']) ? '' : $instance['cssClass'], $instance);
 
40
  $text = apply_filters( 'widget_text', $instance['text'], $instance );
41
  if ( $cssClass ) {
42
  if( strpos($before_widget, 'class') === false ) {
@@ -45,13 +46,13 @@ class EnhancedTextWidget extends WP_Widget {
45
  $before_widget = str_replace('class="', 'class="'. $cssClass . ' ', $before_widget);
46
  }
47
  }
48
- echo $before_widget;
49
  if( $titleUrl && $title )
50
  $title = '<a href="'.$titleUrl.'"'.($newWindow == '1'?' target="_blank"':'').' title="'.$title.'">'.$title.'</a>';
51
- if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
52
  <div class="textwidget"><?php if($instance['filter']) { ob_start(); eval("?>$text<?php "); $output = ob_get_contents(); ob_end_clean(); echo wpautop($output); } else eval("?>".$text."<?php "); ?></div>
53
  <?php
54
- echo $after_widget;
55
  }
56
 
57
  function update( $new_instance, $old_instance ) {
@@ -59,6 +60,7 @@ class EnhancedTextWidget extends WP_Widget {
59
  $instance['title'] = strip_tags($new_instance['title']);
60
  $instance['titleUrl'] = strip_tags($new_instance['titleUrl']);
61
  $instance['cssClass'] = strip_tags($new_instance['cssClass']);
 
62
  $instance['newWindow'] = $new_instance['newWindow'] ? 1 : 0;
63
  if ( current_user_can('unfiltered_html') )
64
  $instance['text'] = $new_instance['text'];
@@ -86,6 +88,10 @@ class EnhancedTextWidget extends WP_Widget {
86
  if(isset($instance['cssClass'])){
87
  $cssClass = strip_tags($instance['cssClass']);
88
  }
 
 
 
 
89
  $text = "";
90
  if(isset($instance['text'])){
91
  $text = format_to_edit($instance['text']);
@@ -97,7 +103,6 @@ class EnhancedTextWidget extends WP_Widget {
97
  <input class="widefat" id="<?php echo $this->get_field_id('titleUrl'); ?>" name="<?php echo $this->get_field_name('titleUrl'); ?>" type="text" value="<?php echo esc_attr($titleUrl); ?>" /></p>
98
  <p><input class="checkbox" type="checkbox" <?php echo $newWindow; ?> id="<?php echo $this->get_field_id('newWindow'); ?>" name="<?php echo $this->get_field_name('newWindow'); ?>" />
99
  <label for="<?php echo $this->get_field_id('newWindow'); ?>"><?php _e('Open the URL in a new window'); ?></label></p>
100
-
101
  <p><label for="<?php echo $this->get_field_id('cssClass'); ?>"><?php _e('CSS Class:'); ?></label>
102
  <input class="widefat" id="<?php echo $this->get_field_id('cssClass'); ?>" name="<?php echo $this->get_field_name('cssClass'); ?>" type="text" value="<?php echo esc_attr($cssClass); ?>" /></p>
103
  <p><label for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Content:'); ?></label>
3
  Plugin Name: Enhanced Text Widget
4
  Plugin URI: http://pomelodesign.com/enhanced-text-widget
5
  Description: An enhanced version of the default text widget where you may have Text, HTML, CSS, JavaScript, Flash, and/or PHP as content with linkable widget title.
6
+ Version: 1.3.2
7
  Author: Pomelo Design
8
  Author URI: http://pomelodesign.com/
9
  License: GPL2
37
  $titleUrl = apply_filters('widget_title', empty($instance['titleUrl']) ? '' : $instance['titleUrl'], $instance);
38
  $newWindow = $instance['newWindow'] ? '1' : '0';
39
  $cssClass = apply_filters('widget_title', empty($instance['cssClass']) ? '' : $instance['cssClass'], $instance);
40
+ $bare = $instance['bare'] ? true : false;
41
  $text = apply_filters( 'widget_text', $instance['text'], $instance );
42
  if ( $cssClass ) {
43
  if( strpos($before_widget, 'class') === false ) {
46
  $before_widget = str_replace('class="', 'class="'. $cssClass . ' ', $before_widget);
47
  }
48
  }
49
+ echo $bare ? '' : $before_widget;
50
  if( $titleUrl && $title )
51
  $title = '<a href="'.$titleUrl.'"'.($newWindow == '1'?' target="_blank"':'').' title="'.$title.'">'.$title.'</a>';
52
+ if ( !empty( $title ) ) { echo $bare ? $title : $before_title . $title . $after_title; } ?>
53
  <div class="textwidget"><?php if($instance['filter']) { ob_start(); eval("?>$text<?php "); $output = ob_get_contents(); ob_end_clean(); echo wpautop($output); } else eval("?>".$text."<?php "); ?></div>
54
  <?php
55
+ echo $bare ? '' : $after_widget;
56
  }
57
 
58
  function update( $new_instance, $old_instance ) {
60
  $instance['title'] = strip_tags($new_instance['title']);
61
  $instance['titleUrl'] = strip_tags($new_instance['titleUrl']);
62
  $instance['cssClass'] = strip_tags($new_instance['cssClass']);
63
+ $instance['bare'] = $new_instance['bare'] ? 1 : 0;
64
  $instance['newWindow'] = $new_instance['newWindow'] ? 1 : 0;
65
  if ( current_user_can('unfiltered_html') )
66
  $instance['text'] = $new_instance['text'];
88
  if(isset($instance['cssClass'])){
89
  $cssClass = strip_tags($instance['cssClass']);
90
  }
91
+ $bare = "";
92
+ if(isset($instance['bare'])){
93
+ $bare = 'checked="checked"';
94
+ }
95
  $text = "";
96
  if(isset($instance['text'])){
97
  $text = format_to_edit($instance['text']);
103
  <input class="widefat" id="<?php echo $this->get_field_id('titleUrl'); ?>" name="<?php echo $this->get_field_name('titleUrl'); ?>" type="text" value="<?php echo esc_attr($titleUrl); ?>" /></p>
104
  <p><input class="checkbox" type="checkbox" <?php echo $newWindow; ?> id="<?php echo $this->get_field_id('newWindow'); ?>" name="<?php echo $this->get_field_name('newWindow'); ?>" />
105
  <label for="<?php echo $this->get_field_id('newWindow'); ?>"><?php _e('Open the URL in a new window'); ?></label></p>
 
106
  <p><label for="<?php echo $this->get_field_id('cssClass'); ?>"><?php _e('CSS Class:'); ?></label>
107
  <input class="widefat" id="<?php echo $this->get_field_id('cssClass'); ?>" name="<?php echo $this->get_field_name('cssClass'); ?>" type="text" value="<?php echo esc_attr($cssClass); ?>" /></p>
108
  <p><label for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Content:'); ?></label>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://pomelodesign.com/donate/
4
  Tags: widget, clickable, linkable, linked title, text, php, javascript, flash, linked title text, linked, text widget, PHP Widget, link widget title, bare widget
5
  Requires at least: 2.8
6
  Tested up to: 3.4
7
- Stable tag: 1.3.1
8
  License: GPL2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -54,6 +54,9 @@ This is the initial release.
54
 
55
  == Changelog ==
56
 
 
 
 
57
  = 1.3 =
58
  * Fixed debug warnings
59
  * Fixed code merge issue
4
  Tags: widget, clickable, linkable, linked title, text, php, javascript, flash, linked title text, linked, text widget, PHP Widget, link widget title, bare widget
5
  Requires at least: 2.8
6
  Tested up to: 3.4
7
+ Stable tag: 1.3.2
8
  License: GPL2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
54
 
55
  == Changelog ==
56
 
57
+ = 1.3.2 =
58
+ * Bug fixes
59
+
60
  = 1.3 =
61
  * Fixed debug warnings
62
  * Fixed code merge issue