Testimonials Widget - Version 0.2.11

Version Description

  • Enable character limit for shortcode
Download this release

Release Info

Developer comprock
Plugin Icon wp plugin Testimonials Widget
Version 0.2.11
Comparing to
See all releases

Code changes from version 0.2.10 to 0.2.11

Files changed (2) hide show
  1. readme.txt +6 -2
  2. testimonials-widget.php +11 -1
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://typo3vagabond.com/about-typo3-vagabond/donate/
4
  Tags: testimonial, testimonials, quote, quotes, quotations, random quote, sidebar, widget
5
  Requires at least: 3.0
6
  Tested up to: 3.4.1
7
- Stable tag: 0.2.10
8
 
9
  Testimonials widget plugin allows you display testimonials in a widget on your WordPress blog.
10
 
@@ -40,9 +40,10 @@ You can make a simple client or portfolio rotator by using the testimonial field
40
  * hide_author - default show; hide_author=true
41
  * hide_source - default show; hide_source=true
42
  * ids - default none; ids=2 or ids="2,4,6"
43
- * limit - default no limit; limit=10
44
  * random - default newest first; random=true
45
  * tags - default none; tags=fire or tags="fire,water"
 
46
  * [testimonialswidget_list] Examples
47
  * [testimonialswidget_list hide_author=true hide_source=true]
48
  * [testimonialswidget_list tags="test,fun" limit=1]
@@ -169,6 +170,9 @@ Change the value of the variable `$testimonialswidget_admin_userlevel` on line 3
169
  = trunk =
170
  -
171
 
 
 
 
172
  = 0.2.10 =
173
  * Character limit nows forces text truncation than preventing of testimonial to show
174
  * Add option - Limit number of testimonials to pull at a time
4
  Tags: testimonial, testimonials, quote, quotes, quotations, random quote, sidebar, widget
5
  Requires at least: 3.0
6
  Tested up to: 3.4.1
7
+ Stable tag: 0.2.11
8
 
9
  Testimonials widget plugin allows you display testimonials in a widget on your WordPress blog.
10
 
40
  * hide_author - default show; hide_author=true
41
  * hide_source - default show; hide_source=true
42
  * ids - default none; ids=2 or ids="2,4,6"
43
+ * limit - default none; limit=10
44
  * random - default newest first; random=true
45
  * tags - default none; tags=fire or tags="fire,water"
46
+ * char_limit - default none; char_limit=200
47
  * [testimonialswidget_list] Examples
48
  * [testimonialswidget_list hide_author=true hide_source=true]
49
  * [testimonialswidget_list tags="test,fun" limit=1]
170
  = trunk =
171
  -
172
 
173
+ = 0.2.11 =
174
+ * Enable character limit for shortcode
175
+
176
  = 0.2.10 =
177
  * Character limit nows forces text truncation than preventing of testimonial to show
178
  * Add option - Limit number of testimonials to pull at a time
testimonials-widget.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Testimonials Widget
4
  Description: Testimonial widget plugin helps you display testimonials in a sidebar on your WordPress blog.
5
- Version: 0.2.10
6
  Author: Michael Cannon
7
  Author URI: http://typo3vagabond.com/about-typo3-vagabond/hire-michael/
8
  License: GPL2
@@ -256,6 +256,12 @@ function testimonialswidget_list_shortcode($atts, $content = null) {
256
  $show_source = ($atts['hide_source']) ? false : true;
257
  $tags = ($atts['tags']) ? $atts['tags'] : false;
258
 
 
 
 
 
 
 
259
  $conditions = " WHERE public = 'yes'";
260
 
261
  if($ids) {
@@ -298,6 +304,10 @@ function testimonialswidget_list_shortcode($atts, $content = null) {
298
  $html .= '<div class="testimonialswidget_testimonials testimonialswidget_testimonials_list">';
299
 
300
  foreach ($testimonials as $testimonial) {
 
 
 
 
301
  $html .= '<div class="testimonialswidget_testimonial testimonialswidget_testimonial_list">';
302
  $html .= "<p><q>". make_clickable( $testimonial['testimonial'] ) ."</q>";
303
 
2
  /*
3
  Plugin Name: Testimonials Widget
4
  Description: Testimonial widget plugin helps you display testimonials in a sidebar on your WordPress blog.
5
+ Version: 0.2.11
6
  Author: Michael Cannon
7
  Author URI: http://typo3vagabond.com/about-typo3-vagabond/hire-michael/
8
  License: GPL2
256
  $show_source = ($atts['hide_source']) ? false : true;
257
  $tags = ($atts['tags']) ? $atts['tags'] : false;
258
 
259
+ if( $atts['char_limit'] && is_numeric($atts['char_limit']) ) {
260
+ $char_limit = intval( $atts['char_limit'] );
261
+ } else {
262
+ $char_limit = false;
263
+ }
264
+
265
  $conditions = " WHERE public = 'yes'";
266
 
267
  if($ids) {
304
  $html .= '<div class="testimonialswidget_testimonials testimonialswidget_testimonials_list">';
305
 
306
  foreach ($testimonials as $testimonial) {
307
+ if( $char_limit ) {
308
+ $testimonial['testimonial'] = testimonialswidget_truncate( $testimonial['testimonial'], $char_limit );
309
+ }
310
+
311
  $html .= '<div class="testimonialswidget_testimonial testimonialswidget_testimonial_list">';
312
  $html .= "<p><q>". make_clickable( $testimonial['testimonial'] ) ."</q>";
313