Testimonials by WooThemes - Version 1.4.0

Version Description

  • Adds "per_row" functionality, a "columns-X" CSS class on the wrapper, support for multiple comma-separated ID values in the "id" argument and a "no-image" CSS class if no image is available for the item.
Download this release

Release Info

Developer mattyza
Plugin Icon wp plugin Testimonials by WooThemes
Version 1.4.0
Comparing to
See all releases

Code changes from version 1.3.1 to 1.4.0

classes/class-woothemes-testimonials.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
7
  * All functionality pertaining to the Testimonials feature.
8
  *
9
  * @package WordPress
10
- * @subpackage WooThemes_Testimonials
11
  * @category Plugin
12
  * @author Matty
13
  * @since 1.0.0
@@ -35,30 +35,30 @@ class Woothemes_Testimonials {
35
  $this->token = 'testimonial';
36
 
37
  $this->load_plugin_textdomain();
38
- add_action( 'init', array( &$this, 'load_localisation' ), 0 );
39
 
40
  // Run this on activation.
41
- register_activation_hook( $this->file, array( &$this, 'activation' ) );
42
 
43
- add_action( 'init', array( &$this, 'register_post_type' ) );
44
  add_action( 'init', array( $this, 'register_taxonomy' ) );
45
 
46
  if ( is_admin() ) {
47
  global $pagenow;
48
 
49
- add_action( 'admin_menu', array( &$this, 'meta_box_setup' ), 20 );
50
- add_action( 'save_post', array( &$this, 'meta_box_save' ) );
51
- add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ) );
52
- add_action( 'admin_print_styles', array( &$this, 'enqueue_admin_styles' ), 10 );
53
- add_filter( 'post_updated_messages', array( &$this, 'updated_messages' ) );
54
 
55
  if ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && esc_attr( $_GET['post_type'] ) == $this->token ) {
56
- add_filter( 'manage_edit-' . $this->token . '_columns', array( &$this, 'register_custom_column_headings' ), 10, 1 );
57
- add_action( 'manage_posts_custom_column', array( &$this, 'register_custom_columns' ), 10, 2 );
58
  }
59
  }
60
 
61
- add_action( 'after_setup_theme', array( &$this, 'ensure_post_thumbnails_support' ) );
62
  } // End __construct()
63
 
64
  /**
@@ -88,6 +88,10 @@ class Woothemes_Testimonials {
88
  'menu_name' => __( 'Testimonials', 'woothemes-testimonials' )
89
 
90
  );
 
 
 
 
91
  $args = array(
92
  'labels' => $labels,
93
  'public' => true,
@@ -95,11 +99,11 @@ class Woothemes_Testimonials {
95
  'show_ui' => true,
96
  'show_in_menu' => true,
97
  'query_var' => true,
98
- 'rewrite' => array( 'slug' => 'testimonial' ),
99
  'capability_type' => 'post',
100
- 'has_archive' => 'testimonials',
101
  'hierarchical' => false,
102
- 'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' ),
103
  'menu_position' => 5,
104
  'menu_icon' => ''
105
  );
@@ -216,7 +220,7 @@ class Woothemes_Testimonials {
216
  * @return void
217
  */
218
  public function meta_box_setup () {
219
- add_meta_box( 'testimonial-data', __( 'Testimonial Details', 'woothemes-testimonials' ), array( &$this, 'meta_box_content' ), $this->token, 'normal', 'high' );
220
  } // End meta_box_setup()
221
 
222
  /**
@@ -423,8 +427,16 @@ class Woothemes_Testimonials {
423
  $query_args['order'] = $args['order'];
424
  $query_args['suppress_filters'] = false;
425
 
426
- if ( is_numeric( $args['id'] ) && ( intval( $args['id'] ) > 0 ) ) {
427
- $query_args['p'] = intval( $args['id'] );
 
 
 
 
 
 
 
 
428
  }
429
 
430
  // Whitelist checks.
@@ -517,6 +529,7 @@ class Woothemes_Testimonials {
517
  */
518
  public function activation () {
519
  $this->register_plugin_version();
 
520
  } // End activation()
521
 
522
  /**
@@ -531,6 +544,17 @@ class Woothemes_Testimonials {
531
  }
532
  } // End register_plugin_version()
533
 
 
 
 
 
 
 
 
 
 
 
 
534
  /**
535
  * Ensure that "post-thumbnails" support is available for those themes that don't register it.
536
  * @since 1.0.1
7
  * All functionality pertaining to the Testimonials feature.
8
  *
9
  * @package WordPress
10
+ * @subpackage Woothemes_Testimonials
11
  * @category Plugin
12
  * @author Matty
13
  * @since 1.0.0
35
  $this->token = 'testimonial';
36
 
37
  $this->load_plugin_textdomain();
38
+ add_action( 'init', array( $this, 'load_localisation' ), 0 );
39
 
40
  // Run this on activation.
41
+ register_activation_hook( $this->file, array( $this, 'activation' ) );
42
 
43
+ add_action( 'init', array( $this, 'register_post_type' ) );
44
  add_action( 'init', array( $this, 'register_taxonomy' ) );
45
 
46
  if ( is_admin() ) {
47
  global $pagenow;
48
 
49
+ add_action( 'admin_menu', array( $this, 'meta_box_setup' ), 20 );
50
+ add_action( 'save_post', array( $this, 'meta_box_save' ) );
51
+ add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) );
52
+ add_action( 'admin_print_styles', array( $this, 'enqueue_admin_styles' ), 10 );
53
+ add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
54
 
55
  if ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && esc_attr( $_GET['post_type'] ) == $this->token ) {
56
+ add_filter( 'manage_edit-' . $this->token . '_columns', array( $this, 'register_custom_column_headings' ), 10, 1 );
57
+ add_action( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
58
  }
59
  }
60
 
61
+ add_action( 'after_setup_theme', array( $this, 'ensure_post_thumbnails_support' ) );
62
  } // End __construct()
63
 
64
  /**
88
  'menu_name' => __( 'Testimonials', 'woothemes-testimonials' )
89
 
90
  );
91
+
92
+ $single_slug = apply_filters( 'woothemes_testimonials_single_slug', _x( 'testimonial', 'single post url slug', 'woothemes-testimonials' ) );
93
+ $archive_slug = apply_filters( 'woothemes_testimonials_archive_slug', _x( 'testimonials', 'post archive url slug', 'woothemes-testimonials' ) );
94
+
95
  $args = array(
96
  'labels' => $labels,
97
  'public' => true,
99
  'show_ui' => true,
100
  'show_in_menu' => true,
101
  'query_var' => true,
102
+ 'rewrite' => array( 'slug' => $single_slug, 'with_front' => false ),
103
  'capability_type' => 'post',
104
+ 'has_archive' => $archive_slug,
105
  'hierarchical' => false,
106
+ 'supports' => array( 'title', 'author' ,'editor', 'thumbnail', 'page-attributes' ),
107
  'menu_position' => 5,
108
  'menu_icon' => ''
109
  );
220
  * @return void
221
  */
222
  public function meta_box_setup () {
223
+ add_meta_box( 'testimonial-data', __( 'Testimonial Details', 'woothemes-testimonials' ), array( $this, 'meta_box_content' ), $this->token, 'normal', 'high' );
224
  } // End meta_box_setup()
225
 
226
  /**
427
  $query_args['order'] = $args['order'];
428
  $query_args['suppress_filters'] = false;
429
 
430
+ $ids = explode( ',', $args['id'] );
431
+ $ids = array_map( 'intval', $ids );
432
+
433
+ if ( 0 < count( $ids ) ) {
434
+ if ( 1 == count( $ids ) && is_numeric( $ids[0] ) && ( 0 < intval( $ids[0] ) ) ) {
435
+ $query_args['p'] = intval( $args['id'] );
436
+ } else {
437
+ $query_args['ignore_sticky_posts'] = 1;
438
+ $query_args['post__in'] = $ids;
439
+ }
440
  }
441
 
442
  // Whitelist checks.
529
  */
530
  public function activation () {
531
  $this->register_plugin_version();
532
+ $this->flush_rewrite_rules();
533
  } // End activation()
534
 
535
  /**
544
  }
545
  } // End register_plugin_version()
546
 
547
+ /**
548
+ * Flush the rewrite rules
549
+ * @access public
550
+ * @since 1.4.0
551
+ * @return void
552
+ */
553
+ private function flush_rewrite_rules () {
554
+ $this->register_post_type();
555
+ flush_rewrite_rules();
556
+ } // End flush_rewrite_rules()
557
+
558
  /**
559
  * Ensure that "post-thumbnails" support is available for those themes that don't register it.
560
  * @since 1.0.1
lang/woothemes-testimonials-en_GB.po CHANGED
@@ -1,15 +1,16 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Testimonials v1.3.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2013-04-30 12:40:13+0000\n"
7
  "Last-Translator: Matty <matt@woothemes.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
13
  "X-Poedit-Language: English\n"
14
  "X-Poedit-Country: UNITED KINGDOM\n"
15
  "X-Poedit-SourceCharset: utf-8\n"
@@ -106,110 +107,110 @@ msgstr ""
106
  msgid "No %s Found In Trash"
107
  msgstr ""
108
 
109
- #: classes/class-woothemes-testimonials.php:159
110
  #@ woothemes-testimonials
111
  msgid "Image"
112
  msgstr ""
113
 
114
- #: classes/class-woothemes-testimonials.php:193
115
  #, php-format
116
  #@ woothemes-testimonials
117
  msgid "Testimonial updated. %sView testimonial%s"
118
  msgstr ""
119
 
120
- #: classes/class-woothemes-testimonials.php:194
121
  #@ woothemes-testimonials
122
  msgid "Custom field updated."
123
  msgstr ""
124
 
125
- #: classes/class-woothemes-testimonials.php:195
126
  #@ woothemes-testimonials
127
  msgid "Custom field deleted."
128
  msgstr ""
129
 
130
- #: classes/class-woothemes-testimonials.php:196
131
  #@ woothemes-testimonials
132
  msgid "Testimonial updated."
133
  msgstr ""
134
 
135
  #. translators: %s: date and time of the revision
136
- #: classes/class-woothemes-testimonials.php:198
137
  #, php-format
138
  #@ woothemes-testimonials
139
  msgid "Testimonial restored to revision from %s"
140
  msgstr ""
141
 
142
- #: classes/class-woothemes-testimonials.php:199
143
  #, php-format
144
  #@ woothemes-testimonials
145
  msgid "Testimonial published. %sView testimonial%s"
146
  msgstr ""
147
 
148
- #: classes/class-woothemes-testimonials.php:200
149
  #@ default
150
  msgid "Testimonial saved."
151
  msgstr ""
152
 
153
- #: classes/class-woothemes-testimonials.php:201
154
  #, php-format
155
  #@ woothemes-testimonials
156
  msgid "Testimonial submitted. %sPreview testimonial%s"
157
  msgstr ""
158
 
159
- #: classes/class-woothemes-testimonials.php:202
160
  #, php-format
161
  #@ woothemes-testimonials
162
  msgid "Testimonial scheduled for: %1$s. %2$sPreview testimonial%3$s"
163
  msgstr ""
164
 
165
- #: classes/class-woothemes-testimonials.php:204
166
  #@ default
167
  msgid "M j, Y @ G:i"
168
  msgstr ""
169
 
170
- #: classes/class-woothemes-testimonials.php:205
171
  #, php-format
172
  #@ woothemes-testimonials
173
  msgid "Testimonial draft updated. %sPreview testimonial%s"
174
  msgstr ""
175
 
176
- #: classes/class-woothemes-testimonials.php:219
177
  #@ woothemes-testimonials
178
  msgid "Testimonial Details"
179
  msgstr ""
180
 
181
- #: classes/class-woothemes-testimonials.php:318
182
  #@ woothemes-testimonials
183
  msgid "Enter the customer's name here"
184
  msgstr ""
185
 
186
- #: classes/class-woothemes-testimonials.php:344
187
  #@ woothemes-testimonials
188
  msgid "Gravatar E-mail Address"
189
  msgstr ""
190
 
191
- #: classes/class-woothemes-testimonials.php:345
192
  #, php-format
193
  #@ woothemes-testimonials
194
  msgid "Enter in an e-mail address, to use a %sGravatar%s, instead of using the \"Featured Image\"."
195
  msgstr ""
196
 
197
- #: classes/class-woothemes-testimonials.php:352
198
  #@ woothemes-testimonials
199
  msgid "Byline"
200
  msgstr ""
201
 
202
- #: classes/class-woothemes-testimonials.php:353
203
  #@ woothemes-testimonials
204
  msgid "Enter a byline for the customer giving this testimonial (for example: \"CEO of WooThemes\")."
205
  msgstr ""
206
 
207
- #: classes/class-woothemes-testimonials.php:360
208
  #@ woothemes-testimonials
209
  msgid "URL"
210
  msgstr ""
211
 
212
- #: classes/class-woothemes-testimonials.php:361
213
  #@ woothemes-testimonials
214
  msgid "Enter a URL that applies to this customer (for example: http://woothemes.com/)."
215
  msgstr ""
@@ -389,3 +390,15 @@ msgstr ""
389
  msgid "All"
390
  msgstr ""
391
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: Testimonials v1.3.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2013-07-31 02:00:10+0000\n"
7
  "Last-Translator: Matty <matt@woothemes.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Generator: CSL v1.x\n"
14
  "X-Poedit-Language: English\n"
15
  "X-Poedit-Country: UNITED KINGDOM\n"
16
  "X-Poedit-SourceCharset: utf-8\n"
107
  msgid "No %s Found In Trash"
108
  msgstr ""
109
 
110
+ #: classes/class-woothemes-testimonials.php:163
111
  #@ woothemes-testimonials
112
  msgid "Image"
113
  msgstr ""
114
 
115
+ #: classes/class-woothemes-testimonials.php:197
116
  #, php-format
117
  #@ woothemes-testimonials
118
  msgid "Testimonial updated. %sView testimonial%s"
119
  msgstr ""
120
 
121
+ #: classes/class-woothemes-testimonials.php:198
122
  #@ woothemes-testimonials
123
  msgid "Custom field updated."
124
  msgstr ""
125
 
126
+ #: classes/class-woothemes-testimonials.php:199
127
  #@ woothemes-testimonials
128
  msgid "Custom field deleted."
129
  msgstr ""
130
 
131
+ #: classes/class-woothemes-testimonials.php:200
132
  #@ woothemes-testimonials
133
  msgid "Testimonial updated."
134
  msgstr ""
135
 
136
  #. translators: %s: date and time of the revision
137
+ #: classes/class-woothemes-testimonials.php:202
138
  #, php-format
139
  #@ woothemes-testimonials
140
  msgid "Testimonial restored to revision from %s"
141
  msgstr ""
142
 
143
+ #: classes/class-woothemes-testimonials.php:203
144
  #, php-format
145
  #@ woothemes-testimonials
146
  msgid "Testimonial published. %sView testimonial%s"
147
  msgstr ""
148
 
149
+ #: classes/class-woothemes-testimonials.php:204
150
  #@ default
151
  msgid "Testimonial saved."
152
  msgstr ""
153
 
154
+ #: classes/class-woothemes-testimonials.php:205
155
  #, php-format
156
  #@ woothemes-testimonials
157
  msgid "Testimonial submitted. %sPreview testimonial%s"
158
  msgstr ""
159
 
160
+ #: classes/class-woothemes-testimonials.php:206
161
  #, php-format
162
  #@ woothemes-testimonials
163
  msgid "Testimonial scheduled for: %1$s. %2$sPreview testimonial%3$s"
164
  msgstr ""
165
 
166
+ #: classes/class-woothemes-testimonials.php:208
167
  #@ default
168
  msgid "M j, Y @ G:i"
169
  msgstr ""
170
 
171
+ #: classes/class-woothemes-testimonials.php:209
172
  #, php-format
173
  #@ woothemes-testimonials
174
  msgid "Testimonial draft updated. %sPreview testimonial%s"
175
  msgstr ""
176
 
177
+ #: classes/class-woothemes-testimonials.php:223
178
  #@ woothemes-testimonials
179
  msgid "Testimonial Details"
180
  msgstr ""
181
 
182
+ #: classes/class-woothemes-testimonials.php:322
183
  #@ woothemes-testimonials
184
  msgid "Enter the customer's name here"
185
  msgstr ""
186
 
187
+ #: classes/class-woothemes-testimonials.php:348
188
  #@ woothemes-testimonials
189
  msgid "Gravatar E-mail Address"
190
  msgstr ""
191
 
192
+ #: classes/class-woothemes-testimonials.php:349
193
  #, php-format
194
  #@ woothemes-testimonials
195
  msgid "Enter in an e-mail address, to use a %sGravatar%s, instead of using the \"Featured Image\"."
196
  msgstr ""
197
 
198
+ #: classes/class-woothemes-testimonials.php:356
199
  #@ woothemes-testimonials
200
  msgid "Byline"
201
  msgstr ""
202
 
203
+ #: classes/class-woothemes-testimonials.php:357
204
  #@ woothemes-testimonials
205
  msgid "Enter a byline for the customer giving this testimonial (for example: \"CEO of WooThemes\")."
206
  msgstr ""
207
 
208
+ #: classes/class-woothemes-testimonials.php:364
209
  #@ woothemes-testimonials
210
  msgid "URL"
211
  msgstr ""
212
 
213
+ #: classes/class-woothemes-testimonials.php:365
214
  #@ woothemes-testimonials
215
  msgid "Enter a URL that applies to this customer (for example: http://woothemes.com/)."
216
  msgstr ""
390
  msgid "All"
391
  msgstr ""
392
 
393
+ #: classes/class-woothemes-testimonials.php:92
394
+ #@ woothemes-testimonials
395
+ msgctxt "single post url slug"
396
+ msgid "testimonial"
397
+ msgstr ""
398
+
399
+ #: classes/class-woothemes-testimonials.php:93
400
+ #@ woothemes-testimonials
401
+ msgctxt "post archive url slug"
402
+ msgid "testimonials"
403
+ msgstr ""
404
+
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.1
7
- Stable tag: 1.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,10 +14,10 @@ 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
- 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
 
@@ -28,6 +28,7 @@ To display your testimonials via a theme or a custom plugin, please use the foll
28
  To add arguments to this, please use any of the following arguments, using the syntax provided below:
29
 
30
  * 'limit' => 5 (the maximum number of items to display)
 
31
  * 'orderby' => 'menu_order' (how to order the items - accepts all default WordPress ordering options)
32
  * 'order' => 'DESC' (the order direction)
33
  * 'id' => 0 (display a specific item)
@@ -94,7 +95,14 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi
94
 
95
  1. The testimonials management screen within the WordPress admin.
96
 
97
- == Upgrade Notice ==
 
 
 
 
 
 
 
98
 
99
  = 1.3.1 =
100
  * Fixes bug where testimonial text doesn't display (incorrectly placed action hook).
@@ -119,6 +127,16 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi
119
 
120
  == Changelog ==
121
 
 
 
 
 
 
 
 
 
 
 
122
  = 1.3.1 =
123
  * 2013-04-30.
124
  * Fixes bug where testimonial text doesn't display (incorrectly placed action hook).
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.6.0
7
+ Stable tag: 1.4.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/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 latest "release-" branch)
21
 
22
  == Usage ==
23
 
28
  To add arguments to this, please use any of the following arguments, using the syntax provided below:
29
 
30
  * 'limit' => 5 (the maximum number of items to display)
31
+ * 'per_row' => 3 (when creating rows, how many items display in a single row?)
32
  * 'orderby' => 'menu_order' (how to order the items - accepts all default WordPress ordering options)
33
  * 'order' => 'DESC' (the order direction)
34
  * 'id' => 0 (display a specific item)
95
 
96
  1. The testimonials management screen within the WordPress admin.
97
 
98
+ == Upgrade Notice =
99
+
100
+ = 1.4.0 =
101
+ * Adds "per_row" functionality, a "columns-X" CSS class on the wrapper, support for multiple comma-separated ID values in the "id" argument and a "no-image" CSS class if no image is available for the item.
102
+
103
+ = 1.3.2 =
104
+ * Adds filters for the single testimonials and testimonial archives URL slugs
105
+ * Adds a flush_rewrite_rules() call on plugin activation
106
 
107
  = 1.3.1 =
108
  * Fixes bug where testimonial text doesn't display (incorrectly placed action hook).
127
 
128
  == Changelog ==
129
 
130
+ = 1.4.0 =
131
+ * 2013-08-20.
132
+ * Adds "per_row" functionality and a "columns-X" CSS class on the wrapper.
133
+ * Adds support for multiple comma-separated ID values in the "id" argument.
134
+ * Adds a "no-image" CSS class if no image is available for the item.
135
+ * Renames the effect CSS class to include "effect-" as a prefix (for example, "effect-fade").
136
+ * Adds "woothemes_testimonials_single_slug" as a filter for the single testimonials URL slug
137
+ * Adds "woothemes_testimonials_archive_slug" as a filter for the testimonials archive URL slug
138
+ * Adds a flush_rewrite_rules() call on plugin activation
139
+
140
  = 1.3.1 =
141
  * 2013-04-30.
142
  * Fixes bug where testimonial text doesn't display (incorrectly placed action hook).
woothemes-testimonials-template.php CHANGED
@@ -33,6 +33,7 @@ function woothemes_testimonials ( $args = '' ) {
33
 
34
  $defaults = array(
35
  'limit' => 5,
 
36
  'orderby' => 'menu_order',
37
  'order' => 'DESC',
38
  'id' => 0,
@@ -65,15 +66,21 @@ function woothemes_testimonials ( $args = '' ) {
65
  // The Display.
66
  if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
67
 
68
- if ( $args['effect'] != 'none' ) {
69
- $effect = ' ' . $args['effect'];
 
 
 
 
 
 
70
  }
71
 
72
  $html .= $args['before'] . "\n";
73
  if ( '' != $args['title'] ) {
74
  $html .= $args['before_title'] . esc_html( $args['title'] ) . $args['after_title'] . "\n";
75
  }
76
- $html .= '<div class="testimonials component' . esc_attr( $effect ) . '">' . "\n";
77
 
78
  $html .= '<div class="testimonials-list">' . "\n";
79
 
@@ -87,7 +94,12 @@ function woothemes_testimonials ( $args = '' ) {
87
 
88
  $css_class = 'quote';
89
  if ( 1 == $count ) { $css_class .= ' first'; }
90
- if ( count( $query ) == $count ) { $css_class .= ' last'; }
 
 
 
 
 
91
 
92
  setup_postdata( $post );
93
 
@@ -135,6 +147,10 @@ function woothemes_testimonials ( $args = '' ) {
135
 
136
  // Assign for output.
137
  $html .= $template;
 
 
 
 
138
  }
139
 
140
  wp_reset_postdata();
@@ -177,6 +193,7 @@ function woothemes_testimonials_shortcode ( $atts, $content = null ) {
177
 
178
  $defaults = array(
179
  'limit' => 5,
 
180
  'orderby' => 'menu_order',
181
  'order' => 'DESC',
182
  'id' => 0,
@@ -197,7 +214,6 @@ function woothemes_testimonials_shortcode ( $atts, $content = null ) {
197
 
198
  // Fix integers.
199
  if ( isset( $args['limit'] ) ) $args['limit'] = intval( $args['limit'] );
200
- if ( isset( $args['id'] ) ) $args['id'] = intval( $args['id'] );
201
  if ( isset( $args['size'] ) && ( 0 < intval( $args['size'] ) ) ) $args['size'] = intval( $args['size'] );
202
  if ( isset( $args['category'] ) && is_numeric( $args['category'] ) ) $args['category'] = intval( $args['category'] );
203
 
33
 
34
  $defaults = array(
35
  'limit' => 5,
36
+ 'per_row' => null,
37
  'orderby' => 'menu_order',
38
  'order' => 'DESC',
39
  'id' => 0,
66
  // The Display.
67
  if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
68
 
69
+ $class = '';
70
+
71
+ if ( is_numeric( $args['per_row'] ) ) {
72
+ $class .= ' columns-' . intval( $args['per_row'] );
73
+ }
74
+
75
+ if ( 'none' != $args['effect'] ) {
76
+ $class .= ' effect-' . $args['effect'];
77
  }
78
 
79
  $html .= $args['before'] . "\n";
80
  if ( '' != $args['title'] ) {
81
  $html .= $args['before_title'] . esc_html( $args['title'] ) . $args['after_title'] . "\n";
82
  }
83
+ $html .= '<div class="testimonials component' . esc_attr( $class ) . '">' . "\n";
84
 
85
  $html .= '<div class="testimonials-list">' . "\n";
86
 
94
 
95
  $css_class = 'quote';
96
  if ( 1 == $count ) { $css_class .= ' first'; }
97
+ if ( $per_row == $count || count( $query ) == $count ) { $css_class .= ' last'; }
98
+
99
+ // Add a CSS class if no image is available.
100
+ if ( isset( $post->image ) && ( '' == $post->image ) ) {
101
+ $css_class .= ' no-image';
102
+ }
103
 
104
  setup_postdata( $post );
105
 
147
 
148
  // Assign for output.
149
  $html .= $template;
150
+
151
+ if( ( 0 == $count % $args['per_row'] ) ) {
152
+ $html .= '<div class="fix"></div>' . "\n";
153
+ }
154
  }
155
 
156
  wp_reset_postdata();
193
 
194
  $defaults = array(
195
  'limit' => 5,
196
+ 'per_row' => null,
197
  'orderby' => 'menu_order',
198
  'order' => 'DESC',
199
  'id' => 0,
214
 
215
  // Fix integers.
216
  if ( isset( $args['limit'] ) ) $args['limit'] = intval( $args['limit'] );
 
217
  if ( isset( $args['size'] ) && ( 0 < intval( $args['size'] ) ) ) $args['size'] = intval( $args['size'] );
218
  if ( isset( $args['category'] ) && is_numeric( $args['category'] ) ) $args['category'] = intval( $args['category'] );
219
 
woothemes-testimonials.php CHANGED
@@ -4,7 +4,7 @@
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.3.1
8
  * Author URI: http://woothemes.com/
9
  *
10
  * @package WordPress
@@ -19,5 +19,5 @@ require_once( 'woothemes-testimonials-template.php' );
19
  require_once( 'classes/class-woothemes-widget-testimonials.php' );
20
  global $woothemes_testimonials;
21
  $woothemes_testimonials = new Woothemes_Testimonials( __FILE__ );
22
- $woothemes_testimonials->version = '1.3.1';
23
  ?>
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.4.0
8
  * Author URI: http://woothemes.com/
9
  *
10
  * @package WordPress
19
  require_once( 'classes/class-woothemes-widget-testimonials.php' );
20
  global $woothemes_testimonials;
21
  $woothemes_testimonials = new Woothemes_Testimonials( __FILE__ );
22
+ $woothemes_testimonials->version = '1.4.0';
23
  ?>