Testimonials by WooThemes - Version 1.2.0

Version Description

  • Adds basic WPML support.
  • Enhancements to the widget output.
  • Adds new arguments for controlling the HTML wrapping the testimonials, as well as wrapping the title.
Download this release

Release Info

Developer woothemes
Plugin Icon wp plugin Testimonials by WooThemes
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.0 to 1.2.0

classes/class-woothemes-testimonials.php CHANGED
@@ -31,7 +31,7 @@ class Woothemes_Testimonials {
31
  $this->dir = dirname( $file );
32
  $this->file = $file;
33
  $this->assets_dir = trailingslashit( $this->dir ) . 'assets';
34
- $this->assets_url = esc_url( str_replace( WP_PLUGIN_DIR, WP_PLUGIN_URL, $this->assets_dir ) );
35
  $this->token = 'testimonial';
36
 
37
  $this->load_plugin_textdomain();
@@ -96,7 +96,7 @@ class Woothemes_Testimonials {
96
  'query_var' => true,
97
  'rewrite' => array( 'slug' => 'testimonial' ),
98
  'capability_type' => 'post',
99
- 'has_archive' => array( 'slug' => 'testimonials' ),
100
  'hierarchical' => false,
101
  'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' ),
102
  'menu_position' => 5,
@@ -408,6 +408,7 @@ class Woothemes_Testimonials {
408
  $query_args['numberposts'] = $args['limit'];
409
  $query_args['orderby'] = $args['orderby'];
410
  $query_args['order'] = $args['order'];
 
411
 
412
  if ( is_numeric( $args['id'] ) && ( intval( $args['id'] ) > 0 ) ) {
413
  $query_args['p'] = intval( $args['id'] );
31
  $this->dir = dirname( $file );
32
  $this->file = $file;
33
  $this->assets_dir = trailingslashit( $this->dir ) . 'assets';
34
+ $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $file ) ) );
35
  $this->token = 'testimonial';
36
 
37
  $this->load_plugin_textdomain();
96
  'query_var' => true,
97
  'rewrite' => array( 'slug' => 'testimonial' ),
98
  'capability_type' => 'post',
99
+ 'has_archive' => 'testimonials',
100
  'hierarchical' => false,
101
  'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' ),
102
  'menu_position' => 5,
408
  $query_args['numberposts'] = $args['limit'];
409
  $query_args['orderby'] = $args['orderby'];
410
  $query_args['order'] = $args['order'];
411
+ $query_args['suppress_filters'] = false;
412
 
413
  if ( is_numeric( $args['id'] ) && ( intval( $args['id'] ) > 0 ) ) {
414
  $query_args['p'] = intval( $args['id'] );
classes/class-woothemes-widget-testimonials.php CHANGED
@@ -67,12 +67,17 @@ class Woothemes_Widget_Testmonials extends WP_Widget {
67
  $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base );
68
 
69
  /* Before widget (defined by themes). */
70
- // echo $before_widget;
71
-
72
  $args = array();
73
 
 
 
 
74
  /* Display the widget title if one was input (before and after defined by themes). */
75
- if ( $title ) { $args['title'] = $title; }
 
 
 
 
76
 
77
  /* Widget content. */
78
  // Add actions for plugins/themes to hook onto.
@@ -97,10 +102,6 @@ class Woothemes_Widget_Testmonials extends WP_Widget {
97
 
98
  // Add actions for plugins/themes to hook onto.
99
  do_action( $this->woothemes_widget_cssclass . '_bottom' );
100
-
101
- /* After widget (defined by themes). */
102
- // echo $after_widget;
103
-
104
  } // End widget()
105
 
106
  /**
67
  $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base );
68
 
69
  /* Before widget (defined by themes). */
 
 
70
  $args = array();
71
 
72
+ $args['before'] = $before_widget;
73
+ $args['after'] = $after_widget;
74
+
75
  /* Display the widget title if one was input (before and after defined by themes). */
76
+ if ( $title ) {
77
+ $args['before_title'] = $before_title;
78
+ $args['title'] = $title;
79
+ $args['after_title'] = $after_title;
80
+ }
81
 
82
  /* Widget content. */
83
  // Add actions for plugins/themes to hook onto.
102
 
103
  // Add actions for plugins/themes to hook onto.
104
  do_action( $this->woothemes_widget_cssclass . '_bottom' );
 
 
 
 
105
  } // End widget()
106
 
107
  /**
lang/woothemes-testimonials-en_GB.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Testimonials v1.0.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2012-11-08 07:48:44+0000\n"
7
  "Last-Translator: Matty <matt@woothemes.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -216,97 +216,97 @@ msgstr ""
216
  msgid "Recent testimonials on your site."
217
  msgstr ""
218
 
219
- #: classes/class-woothemes-widget-testimonials.php:165
220
  #@ woothemes-testimonials
221
  msgid "Title (optional):"
222
  msgstr ""
223
 
224
- #: classes/class-woothemes-widget-testimonials.php:170
225
  #@ woothemes-testimonials
226
  msgid "Limit:"
227
  msgstr ""
228
 
229
- #: classes/class-woothemes-widget-testimonials.php:175
230
  #@ woothemes-testimonials
231
  msgid "Image Size (in pixels):"
232
  msgstr ""
233
 
234
- #: classes/class-woothemes-widget-testimonials.php:180
235
  #@ woothemes-testimonials
236
  msgid "Order By:"
237
  msgstr ""
238
 
239
- #: classes/class-woothemes-widget-testimonials.php:189
240
  #@ woothemes-testimonials
241
  msgid "Order Direction:"
242
  msgstr ""
243
 
244
- #: classes/class-woothemes-widget-testimonials.php:199
245
  #@ woothemes-testimonials
246
  msgid "Display Author"
247
  msgstr ""
248
 
249
- #: classes/class-woothemes-widget-testimonials.php:209
250
  #@ woothemes-testimonials
251
  msgid "Display URL"
252
  msgstr ""
253
 
254
- #: classes/class-woothemes-widget-testimonials.php:213
255
  #@ woothemes-testimonials
256
  msgid "Specific ID (optional):"
257
  msgstr ""
258
 
259
- #: classes/class-woothemes-widget-testimonials.php:216
260
  #@ woothemes-testimonials
261
  msgid "Display a specific testimonial, rather than a list."
262
  msgstr ""
263
 
264
- #: classes/class-woothemes-widget-testimonials.php:227
265
  #@ woothemes-testimonials
266
  msgid "No Order"
267
  msgstr ""
268
 
269
- #: classes/class-woothemes-widget-testimonials.php:228
270
  #@ woothemes-testimonials
271
  msgid "Entry ID"
272
  msgstr ""
273
 
274
- #: classes/class-woothemes-widget-testimonials.php:229
275
  #@ woothemes-testimonials
276
  msgid "Title"
277
  msgstr ""
278
 
279
- #: classes/class-woothemes-widget-testimonials.php:230
280
  #@ woothemes-testimonials
281
  msgid "Date Added"
282
  msgstr ""
283
 
284
- #: classes/class-woothemes-widget-testimonials.php:231
285
  #@ woothemes-testimonials
286
  msgid "Specified Order Setting"
287
  msgstr ""
288
 
289
- #: classes/class-woothemes-widget-testimonials.php:242
290
  #@ woothemes-testimonials
291
  msgid "Ascending"
292
  msgstr ""
293
 
294
- #: classes/class-woothemes-widget-testimonials.php:243
295
  #@ woothemes-testimonials
296
  msgid "Descending"
297
  msgstr ""
298
 
299
- #: woothemes-testimonials-template.php:140
300
  #@ woothemes-testimonials
301
  msgid "Previous"
302
  msgstr ""
303
 
304
- #: woothemes-testimonials-template.php:141
305
  #@ woothemes-testimonials
306
  msgid "Next"
307
  msgstr ""
308
 
309
- #: classes/class-woothemes-widget-testimonials.php:204
310
  #@ woothemes-testimonials
311
  msgid "Display Avatar"
312
  msgstr ""
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: Testimonials v1.2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2012-11-28 09:51:33+0000\n"
7
  "Last-Translator: Matty <matt@woothemes.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
216
  msgid "Recent testimonials on your site."
217
  msgstr ""
218
 
219
+ #: classes/class-woothemes-widget-testimonials.php:166
220
  #@ woothemes-testimonials
221
  msgid "Title (optional):"
222
  msgstr ""
223
 
224
+ #: classes/class-woothemes-widget-testimonials.php:171
225
  #@ woothemes-testimonials
226
  msgid "Limit:"
227
  msgstr ""
228
 
229
+ #: classes/class-woothemes-widget-testimonials.php:176
230
  #@ woothemes-testimonials
231
  msgid "Image Size (in pixels):"
232
  msgstr ""
233
 
234
+ #: classes/class-woothemes-widget-testimonials.php:181
235
  #@ woothemes-testimonials
236
  msgid "Order By:"
237
  msgstr ""
238
 
239
+ #: classes/class-woothemes-widget-testimonials.php:190
240
  #@ woothemes-testimonials
241
  msgid "Order Direction:"
242
  msgstr ""
243
 
244
+ #: classes/class-woothemes-widget-testimonials.php:200
245
  #@ woothemes-testimonials
246
  msgid "Display Author"
247
  msgstr ""
248
 
249
+ #: classes/class-woothemes-widget-testimonials.php:210
250
  #@ woothemes-testimonials
251
  msgid "Display URL"
252
  msgstr ""
253
 
254
+ #: classes/class-woothemes-widget-testimonials.php:214
255
  #@ woothemes-testimonials
256
  msgid "Specific ID (optional):"
257
  msgstr ""
258
 
259
+ #: classes/class-woothemes-widget-testimonials.php:217
260
  #@ woothemes-testimonials
261
  msgid "Display a specific testimonial, rather than a list."
262
  msgstr ""
263
 
264
+ #: classes/class-woothemes-widget-testimonials.php:228
265
  #@ woothemes-testimonials
266
  msgid "No Order"
267
  msgstr ""
268
 
269
+ #: classes/class-woothemes-widget-testimonials.php:229
270
  #@ woothemes-testimonials
271
  msgid "Entry ID"
272
  msgstr ""
273
 
274
+ #: classes/class-woothemes-widget-testimonials.php:230
275
  #@ woothemes-testimonials
276
  msgid "Title"
277
  msgstr ""
278
 
279
+ #: classes/class-woothemes-widget-testimonials.php:231
280
  #@ woothemes-testimonials
281
  msgid "Date Added"
282
  msgstr ""
283
 
284
+ #: classes/class-woothemes-widget-testimonials.php:232
285
  #@ woothemes-testimonials
286
  msgid "Specified Order Setting"
287
  msgstr ""
288
 
289
+ #: classes/class-woothemes-widget-testimonials.php:243
290
  #@ woothemes-testimonials
291
  msgid "Ascending"
292
  msgstr ""
293
 
294
+ #: classes/class-woothemes-widget-testimonials.php:244
295
  #@ woothemes-testimonials
296
  msgid "Descending"
297
  msgstr ""
298
 
299
+ #: woothemes-testimonials-template.php:145
300
  #@ woothemes-testimonials
301
  msgid "Previous"
302
  msgstr ""
303
 
304
+ #: woothemes-testimonials-template.php:146
305
  #@ woothemes-testimonials
306
  msgid "Next"
307
  msgstr ""
308
 
309
+ #: classes/class-woothemes-widget-testimonials.php:205
310
  #@ woothemes-testimonials
311
  msgid "Display Avatar"
312
  msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: woothemes, mattyza, jameskoster
3
  Donate link: http://woothemes.com/
4
  Tags: testimonials, widget, shortcode, template-tag, feedback, customers
5
  Requires at least: 3.4.2
6
- Tested up to: 3.5-beta2
7
- Stable tag: 1.1.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,6 +14,11 @@ Show off what your customers are saying about your business and how great they s
14
 
15
  "Testimonials by WooThemes" is a clean and easy-to-use testimonials management system for WordPress. Load in what your customers are saying about your business, and display the testimonials via a shortcode, widget or template tag on your website.
16
 
 
 
 
 
 
17
  == Usage ==
18
 
19
  To display your testimonials via a theme or a custom plugin, please use the following code:
@@ -32,11 +37,39 @@ To add arguments to this, please use any of the following arguments, using the s
32
  * 'echo' => true (whether to display or return the data - useful with the template tag)
33
  * 'size' => 50 (the pixel dimensions of the image)
34
  * 'title' => '' (an optional title)
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  `<?php do_action( 'woothemes_testimonials', array( 'limit' => 10, 'display_author' => false ) ); ?>`
37
 
38
  The same arguments apply to the shortcode which is `[woothemes_testimonials]` and the template tag, which is `<?php woothemes_testimonials(); ?>`.
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  == Installation ==
41
 
42
  Installing "Testimonials by WooThemes" can be done either by searching for "Testimonials by WooThemes" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
@@ -62,6 +95,11 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi
62
 
63
  == Upgrade Notice ==
64
 
 
 
 
 
 
65
  = 1.1.0 =
66
  * Added avatar display options and performed routine plugin maintenance.
67
 
@@ -70,6 +108,13 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi
70
 
71
  == Changelog ==
72
 
 
 
 
 
 
 
 
73
  = 1.1.0 =
74
  * 2012-11-08
75
  * Added option to display or hide the avatar.
3
  Donate link: http://woothemes.com/
4
  Tags: testimonials, widget, shortcode, template-tag, feedback, customers
5
  Requires at least: 3.4.2
6
+ Tested up to: 3.5-beta3
7
+ Stable tag: 1.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
14
 
15
  "Testimonials by WooThemes" is a clean and easy-to-use testimonials management system for WordPress. Load in what your customers are saying about your business, and display the testimonials via a shortcode, widget or template tag on your website.
16
 
17
+ Looking for a helping hand? [View plugin documentation](http://wordpress.org/extend/plugins/testimonials-by-woothemes/other_notes/).
18
+
19
+ Looking to contribute code to this plugin? [Fork the repository over at GitHub](http://github.com/woothemes/testimonials/).
20
+ (submit pull requests to the "develop" branch)
21
+
22
  == Usage ==
23
 
24
  To display your testimonials via a theme or a custom plugin, please use the following code:
37
  * 'echo' => true (whether to display or return the data - useful with the template tag)
38
  * 'size' => 50 (the pixel dimensions of the image)
39
  * 'title' => '' (an optional title)
40
+ * 'before' => '&lt;div class="widget widget_woothemes_testimonials"&gt;' (the starting HTML, wrapping the testimonials)
41
+ * 'after' => '&lt;/div&gt;' (the ending HTML, wrapping the testimonials)
42
+ * 'before_title' => '&lt;h2&gt;' (the starting HTML, wrapping the title)
43
+ * 'after_title' => '&lt;/h2&gt;' (the ending HTML, wrapping the title)
44
+
45
+ The various options for the "orderby" parameter are:
46
+
47
+ * 'none'
48
+ * 'ID'
49
+ * 'title'
50
+ * 'date'
51
+ * 'menu_order'
52
 
53
  `<?php do_action( 'woothemes_testimonials', array( 'limit' => 10, 'display_author' => false ) ); ?>`
54
 
55
  The same arguments apply to the shortcode which is `[woothemes_testimonials]` and the template tag, which is `<?php woothemes_testimonials(); ?>`.
56
 
57
+ == Usage Examples ==
58
+
59
+ Adjusting the limit and image dimension, using the arguments in the three possible methods:
60
+
61
+ do_action() call:
62
+
63
+ `<?php do_action( 'woothemes_testimonials', array( 'limit' => 10, 'size' => 100 ) ); ?>`
64
+
65
+ woothemes_testimonials() template tag:
66
+
67
+ `<?php woothemes_testimonials( array( 'limit' => 10, 'size' => 100 ) ); ?>`
68
+
69
+ [woothemes_testimonials] shortcode:
70
+
71
+ `[woothemes_testimonials limit="10" size="100"]`
72
+
73
  == Installation ==
74
 
75
  Installing "Testimonials by WooThemes" can be done either by searching for "Testimonials by WooThemes" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
95
 
96
  == Upgrade Notice ==
97
 
98
+ = 1.2.0 =
99
+ * Adds basic WPML support.
100
+ * Enhancements to the widget output.
101
+ * Adds new arguments for controlling the HTML wrapping the testimonials, as well as wrapping the title.
102
+
103
  = 1.1.0 =
104
  * Added avatar display options and performed routine plugin maintenance.
105
 
108
 
109
  == Changelog ==
110
 
111
+ = 1.2.0 =
112
+ * 2012-11-28
113
+ * Adds basic WPML support to the get_features() method.
114
+ * Moves the "title" outside of the ".testimonials" DIV tag.
115
+ * Adds "before" and "after" arguments for filtering the HTML for the container. Integrate the $before_widget and $after widget variables to use these parameters with the widget.
116
+ * Adds "before_title" and "after_title" arguments, for filtering the title's wrapping HTML. Integrate the $before_title and $after_title widget variables to use these parameters with the widget.
117
+
118
  = 1.1.0 =
119
  * 2012-11-08
120
  * Added option to display or hide the avatar.
woothemes-testimonials-template.php CHANGED
@@ -43,7 +43,11 @@ function woothemes_testimonials ( $args = '' ) {
43
  'pagination' => false,
44
  'echo' => true,
45
  'size' => 50,
46
- 'title' => ''
 
 
 
 
47
  );
48
 
49
  $args = wp_parse_args( $args, $defaults );
@@ -64,12 +68,11 @@ function woothemes_testimonials ( $args = '' ) {
64
  $effect = ' ' . $args['effect'];
65
  }
66
 
67
- $html .= '<div class="widget widget_woothemes_testimonials">' . "\n";
68
- $html .= '<div class="testimonials component' . $effect . '">' . "\n";
69
-
70
  if ( '' != $args['title'] ) {
71
- $html .= '<h2>' . esc_html( $args['title'] ) . '</h2>' . "\n";
72
  }
 
73
 
74
  $html .= '<div class="testimonials-list">' . "\n";
75
 
@@ -132,6 +135,8 @@ function woothemes_testimonials ( $args = '' ) {
132
  // Assign for output.
133
  $html .= $template;
134
  }
 
 
135
 
136
  $html .= '</div><!--/.testimonials-list-->' . "\n";
137
 
@@ -143,7 +148,7 @@ function woothemes_testimonials ( $args = '' ) {
143
  }
144
  $html .= '<div class="fix"></div>' . "\n";
145
  $html .= '</div><!--/.testimonials-->' . "\n";
146
- $html .= '</div>' . "\n";
147
  }
148
 
149
  // Allow child themes/plugins to filter here.
43
  'pagination' => false,
44
  'echo' => true,
45
  'size' => 50,
46
+ 'title' => '',
47
+ 'before' => '<div class="widget widget_woothemes_testimonials">',
48
+ 'after' => '</div>',
49
+ 'before_title' => '<h2>',
50
+ 'after_title' => '</h2>'
51
  );
52
 
53
  $args = wp_parse_args( $args, $defaults );
68
  $effect = ' ' . $args['effect'];
69
  }
70
 
71
+ $html .= $args['before'] . "\n";
 
 
72
  if ( '' != $args['title'] ) {
73
+ $html .= $args['before_title'] . esc_html( $args['title'] ) . $args['after_title'] . "\n";
74
  }
75
+ $html .= '<div class="testimonials component' . $effect . '">' . "\n";
76
 
77
  $html .= '<div class="testimonials-list">' . "\n";
78
 
135
  // Assign for output.
136
  $html .= $template;
137
  }
138
+
139
+ wp_reset_postdata();
140
 
141
  $html .= '</div><!--/.testimonials-list-->' . "\n";
142
 
148
  }
149
  $html .= '<div class="fix"></div>' . "\n";
150
  $html .= '</div><!--/.testimonials-->' . "\n";
151
+ $html .= $args['after'] . "\n";
152
  }
153
 
154
  // Allow child themes/plugins to filter here.
woothemes-testimonials.php CHANGED
@@ -4,11 +4,11 @@
4
  * Plugin URI: http://woothemes.com/
5
  * Description: Hi, I'm your testimonials management plugin for WordPress. Show off what your customers or website users are saying about your business and how great they say you are, using our shortcode, widget or template tag.
6
  * Author: WooThemes
7
- * Version: 1.1.0
8
  * Author URI: http://woothemes.com/
9
  *
10
  * @package WordPress
11
- * @subpackage WooThemes_Testimonials
12
  * @author Matty
13
  * @since 1.0.0
14
  */
4
  * Plugin URI: http://woothemes.com/
5
  * Description: Hi, I'm your testimonials management plugin for WordPress. Show off what your customers or website users are saying about your business and how great they say you are, using our shortcode, widget or template tag.
6
  * Author: WooThemes
7
+ * Version: 1.2.0
8
  * Author URI: http://woothemes.com/
9
  *
10
  * @package WordPress
11
+ * @subpackage Woothemes_Testimonials
12
  * @author Matty
13
  * @since 1.0.0
14
  */