Enhanced Text Widget - Version 1.4.2

Version Description

  • Removes widget caching
  • Fixes issue with multiline PHP code
Download this release

Release Info

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

Code changes from version 1.4.1 to 1.4.2

Files changed (2) hide show
  1. enhanced-text-widget.php +4 -32
  2. readme.txt +6 -2
enhanced-text-widget.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /*
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.4.1
7
- Author: Pomelo Design
8
  Author URI: http://pomelodesign.com/
9
  License: GPL2
10
 
@@ -39,28 +39,17 @@ class EnhancedTextWidget extends WP_Widget {
39
  * Setup the widget output
40
  */
41
  function widget( $args, $instance ) {
42
- $cache = wp_cache_get('EnhancedTextWidget', 'widget');
43
-
44
- if (!is_array($cache)) {
45
- $cache = array();
46
- }
47
 
48
  if (!isset($args['widget_id'])) {
49
  $args['widget_id'] = null;
50
  }
51
 
52
- if (isset($cache[$args['widget_id']])) {
53
- echo $cache[$args['widget_id']];
54
- return;
55
- }
56
-
57
- ob_start();
58
  extract($args);
59
 
60
  $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance);
61
  $titleUrl = empty($instance['titleUrl']) ? '' : $instance['titleUrl'];
62
  $cssClass = empty($instance['cssClass']) ? '' : $instance['cssClass'];
63
- $text = apply_filters('widget_text', $instance['text'], $instance);
64
  $hideTitle = !empty($instance['hideTitle']) ? true : false;
65
  $newWindow = !empty($instance['newWindow']) ? true : false;
66
  $filterText = !empty($instance['filter']) ? true : false;
@@ -99,8 +88,6 @@ class EnhancedTextWidget extends WP_Widget {
99
 
100
  echo $bare ? '' : '</div>' . $after_widget;
101
 
102
- $cache[$args['widget_id']] = ob_get_flush();
103
- wp_cache_set('EnhancedTextWidget', $cache, 'widget');
104
  }
105
 
106
  /**
@@ -120,24 +107,9 @@ class EnhancedTextWidget extends WP_Widget {
120
  $instance['filter'] = isset($new_instance['filter']);
121
  $instance['bare'] = isset($new_instance['bare']);
122
 
123
- $this->flush_widget_cache();
124
-
125
- $alloptions = wp_cache_get('alloptions', 'options');
126
-
127
- if (isset($alloptions['EnhancedTextWidget'])) {
128
- delete_option('EnhancedTextWidget');
129
- }
130
-
131
  return $instance;
132
  }
133
 
134
- /**
135
- * Flush widget cache
136
- */
137
- function flush_widget_cache() {
138
- wp_cache_delete('EnhancedTextWidget', 'widget');
139
- }
140
-
141
  /**
142
  * Setup the widget admin form
143
  */
1
  <?php
2
  /*
3
  Plugin Name: Enhanced Text Widget
4
+ Plugin URI: http://wordpress.org/plugins/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.4.2
7
+ Author: Boston Dell-Vandenberg
8
  Author URI: http://pomelodesign.com/
9
  License: GPL2
10
 
39
  * Setup the widget output
40
  */
41
  function widget( $args, $instance ) {
 
 
 
 
 
42
 
43
  if (!isset($args['widget_id'])) {
44
  $args['widget_id'] = null;
45
  }
46
 
 
 
 
 
 
 
47
  extract($args);
48
 
49
  $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance);
50
  $titleUrl = empty($instance['titleUrl']) ? '' : $instance['titleUrl'];
51
  $cssClass = empty($instance['cssClass']) ? '' : $instance['cssClass'];
52
+ $text = apply_filters('widget_enhanced_text', $instance['text'], $instance);
53
  $hideTitle = !empty($instance['hideTitle']) ? true : false;
54
  $newWindow = !empty($instance['newWindow']) ? true : false;
55
  $filterText = !empty($instance['filter']) ? true : false;
88
 
89
  echo $bare ? '' : '</div>' . $after_widget;
90
 
 
 
91
  }
92
 
93
  /**
107
  $instance['filter'] = isset($new_instance['filter']);
108
  $instance['bare'] = isset($new_instance['bare']);
109
 
 
 
 
 
 
 
 
 
110
  return $instance;
111
  }
112
 
 
 
 
 
 
 
 
113
  /**
114
  * Setup the widget admin form
115
  */
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, widget shortcodes
5
  Requires at least: 3.0
6
  Tested up to: 3.5.1
7
- Stable tag: 1.4.1
8
  License: GPL2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -25,7 +25,7 @@ Options:
25
  * Automatically add paragraphs
26
  * Do not output before/after_widget/title
27
 
28
- For support please [wordpress.org](http://wordpress.org/support/plugin/enhanced-text-widget). Visit [our website](http://pomelodesign.com), follow [@pomelod](http://twitter.com/pomelod/) or like [on facebook](http://www.facebook.com/pomelodesign/) for updates.
29
 
30
  Fork or contribute on [Github](https://github.com/bostondv/enhanced-text-widget)
31
 
@@ -60,6 +60,10 @@ This is the initial release.
60
 
61
  == Changelog ==
62
 
 
 
 
 
63
  = 1.4 =
64
  * Display text field in monospace font
65
  * Code refactoring
4
  Tags: widget, clickable, linkable, linked title, text, php, javascript, flash, linked title text, linked, text widget, php widget, link widget title, bare widget, widget shortcodes
5
  Requires at least: 3.0
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.4.2
8
  License: GPL2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
25
  * Automatically add paragraphs
26
  * Do not output before/after_widget/title
27
 
28
+ For support please [wordpress.org](http://wordpress.org/support/plugin/enhanced-text-widget). Visit [our website](http://pomelodesign.com), follow [@bostondv](http://twitter.com/bostondv/) or like [on facebook](http://www.facebook.com/pomelodesign/) for updates.
29
 
30
  Fork or contribute on [Github](https://github.com/bostondv/enhanced-text-widget)
31
 
60
 
61
  == Changelog ==
62
 
63
+ = 1.4.2 =
64
+ * Removes widget caching
65
+ * Fixes issue with multiline PHP code
66
+
67
  = 1.4 =
68
  * Display text field in monospace font
69
  * Code refactoring