Features 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 features, as well as wrapping the title.
  • Ads support for the excerpt.
Download this release

Release Info

Developer woothemes
Plugin Icon wp plugin Features 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-features.php CHANGED
@@ -31,7 +31,7 @@ class Woothemes_Features {
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 = 'feature';
36
 
37
  $this->load_plugin_textdomain();
@@ -66,8 +66,8 @@ class Woothemes_Features {
66
  *
67
  * @access public
68
  * @param string $token
69
- * @param string 'Testimonial'
70
- * @param string 'Testimonials'
71
  * @param array $supports
72
  * @return void
73
  */
@@ -80,7 +80,7 @@ class Woothemes_Features {
80
  'edit_item' => sprintf( __( 'Edit %s', 'woothemes-features' ), __( 'Feature', 'woothemes-features' ) ),
81
  'new_item' => sprintf( __( 'New %s', 'woothemes-features' ), __( 'Feature', 'woothemes-features' ) ),
82
  'all_items' => sprintf( __( 'All %s', 'woothemes-features' ), __( 'Features', 'woothemes-features' ) ),
83
- 'view_item' => sprintf( __( 'View %s', 'woothemes-features' ), __( 'Testimonial', 'woothemes-features' ) ),
84
  'search_items' => sprintf( __( 'Search %a', 'woothemes-features' ), __( 'Features', 'woothemes-features' ) ),
85
  'not_found' => sprintf( __( 'No %s Found', 'woothemes-features' ), __( 'Features', 'woothemes-features' ) ),
86
  'not_found_in_trash' => sprintf( __( 'No %s Found In Trash', 'woothemes-features' ), __( 'Features', 'woothemes-features' ) ),
@@ -97,9 +97,9 @@ class Woothemes_Features {
97
  'query_var' => true,
98
  'rewrite' => array( 'slug' => 'feature' ),
99
  'capability_type' => 'post',
100
- 'has_archive' => array( 'slug' => 'features' ),
101
  'hierarchical' => false,
102
- 'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' ),
103
  'menu_position' => 5,
104
  'menu_icon' => ''
105
  );
@@ -317,7 +317,7 @@ class Woothemes_Features {
317
  * @return void
318
  */
319
  public function enqueue_admin_styles () {
320
- wp_register_style( 'woothemes-features-admin', $this->assets_url . '/css/admin.css', array(), '1.0.2' );
321
  wp_enqueue_style( 'woothemes-features-admin' );
322
  } // End enqueue_admin_styles()
323
 
@@ -399,6 +399,7 @@ class Woothemes_Features {
399
  $query_args['numberposts'] = $args['limit'];
400
  $query_args['orderby'] = $args['orderby'];
401
  $query_args['order'] = $args['order'];
 
402
 
403
  if ( is_numeric( $args['id'] ) && ( intval( $args['id'] ) > 0 ) ) {
404
  $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 = 'feature';
36
 
37
  $this->load_plugin_textdomain();
66
  *
67
  * @access public
68
  * @param string $token
69
+ * @param string 'Features'
70
+ * @param string 'Features'
71
  * @param array $supports
72
  * @return void
73
  */
80
  'edit_item' => sprintf( __( 'Edit %s', 'woothemes-features' ), __( 'Feature', 'woothemes-features' ) ),
81
  'new_item' => sprintf( __( 'New %s', 'woothemes-features' ), __( 'Feature', 'woothemes-features' ) ),
82
  'all_items' => sprintf( __( 'All %s', 'woothemes-features' ), __( 'Features', 'woothemes-features' ) ),
83
+ 'view_item' => sprintf( __( 'View %s', 'woothemes-features' ), __( 'Feature', 'woothemes-features' ) ),
84
  'search_items' => sprintf( __( 'Search %a', 'woothemes-features' ), __( 'Features', 'woothemes-features' ) ),
85
  'not_found' => sprintf( __( 'No %s Found', 'woothemes-features' ), __( 'Features', 'woothemes-features' ) ),
86
  'not_found_in_trash' => sprintf( __( 'No %s Found In Trash', 'woothemes-features' ), __( 'Features', 'woothemes-features' ) ),
97
  'query_var' => true,
98
  'rewrite' => array( 'slug' => 'feature' ),
99
  'capability_type' => 'post',
100
+ 'has_archive' => true,
101
  'hierarchical' => false,
102
+ 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes' ),
103
  'menu_position' => 5,
104
  'menu_icon' => ''
105
  );
317
  * @return void
318
  */
319
  public function enqueue_admin_styles () {
320
+ wp_register_style( 'woothemes-features-admin', esc_url( $this->assets_url . 'css/admin.css' ), array(), '1.0.2' );
321
  wp_enqueue_style( 'woothemes-features-admin' );
322
  } // End enqueue_admin_styles()
323
 
399
  $query_args['numberposts'] = $args['limit'];
400
  $query_args['orderby'] = $args['orderby'];
401
  $query_args['order'] = $args['order'];
402
+ $query_args['suppress_filters'] = 0;
403
 
404
  if ( is_numeric( $args['id'] ) && ( intval( $args['id'] ) > 0 ) ) {
405
  $query_args['p'] = intval( $args['id'] );
classes/class-woothemes-widget-features.php CHANGED
@@ -67,12 +67,16 @@ class Woothemes_Widget_Features 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.
@@ -95,7 +99,7 @@ class Woothemes_Widget_Features extends WP_Widget {
95
  do_action( $this->woothemes_widget_cssclass . '_bottom' );
96
 
97
  /* After widget (defined by themes). */
98
- // echo $after_widget;
99
  } // End widget()
100
 
101
  /**
@@ -190,7 +194,7 @@ class Woothemes_Widget_Features extends WP_Widget {
190
  <label for="<?php echo $this->get_field_id( 'specific_id' ); ?>"><?php _e( 'Specific ID (optional):', 'woothemes-features' ); ?></label>
191
  <input type="text" name="<?php echo $this->get_field_name( 'specific_id' ); ?>" value="<?php echo $instance['specific_id']; ?>" class="widefat" id="<?php echo $this->get_field_id( 'specific_id' ); ?>" />
192
  </p>
193
- <p><small><?php _e( 'Display a specific testimonial, rather than a list.', 'woothemes-features' ); ?></small></p>
194
  <?php
195
  } // End form()
196
 
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
+
74
  /* Display the widget title if one was input (before and after defined by themes). */
75
+ if ( $title ) {
76
+ $args['title'] = $title;
77
+ $args['before_title'] = $before_title;
78
+ $args['after_title'] = $after_title;
79
+ }
80
 
81
  /* Widget content. */
82
  // Add actions for plugins/themes to hook onto.
99
  do_action( $this->woothemes_widget_cssclass . '_bottom' );
100
 
101
  /* After widget (defined by themes). */
102
+ $args['after'] = $after_widget;
103
  } // End widget()
104
 
105
  /**
194
  <label for="<?php echo $this->get_field_id( 'specific_id' ); ?>"><?php _e( 'Specific ID (optional):', 'woothemes-features' ); ?></label>
195
  <input type="text" name="<?php echo $this->get_field_name( 'specific_id' ); ?>" value="<?php echo $instance['specific_id']; ?>" class="widefat" id="<?php echo $this->get_field_id( 'specific_id' ); ?>" />
196
  </p>
197
+ <p><small><?php _e( 'Display a specific feature, rather than a list.', 'woothemes-features' ); ?></small></p>
198
  <?php
199
  } // End form()
200
 
lang/woothemes-features-en_GB.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Features v1.1.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2012-11-08 08:28:45+0000\n"
7
  "Last-Translator: Matt <matt@woothemes.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -46,6 +46,7 @@ msgstr ""
46
  #: classes/class-woothemes-features.php:79
47
  #: classes/class-woothemes-features.php:80
48
  #: classes/class-woothemes-features.php:81
 
49
  #@ woothemes-features
50
  msgid "Feature"
51
  msgstr ""
@@ -84,11 +85,6 @@ msgstr ""
84
  msgid "View %s"
85
  msgstr ""
86
 
87
- #: classes/class-woothemes-features.php:83
88
- #@ woothemes-features
89
- msgid "Testimonial"
90
- msgstr ""
91
-
92
  #: classes/class-woothemes-features.php:84
93
  #, php-format
94
  #@ woothemes-features
@@ -184,72 +180,67 @@ msgstr ""
184
  msgid "Recent features listed on your site."
185
  msgstr ""
186
 
187
- #: classes/class-woothemes-widget-features.php:152
188
  #@ woothemes-features
189
  msgid "Title (optional):"
190
  msgstr ""
191
 
192
- #: classes/class-woothemes-widget-features.php:157
193
  #@ woothemes-features
194
  msgid "Limit:"
195
  msgstr ""
196
 
197
- #: classes/class-woothemes-widget-features.php:162
198
  #@ woothemes-features
199
  msgid "Image Size (in pixels):"
200
  msgstr ""
201
 
202
- #: classes/class-woothemes-widget-features.php:172
203
  #@ woothemes-features
204
  msgid "Order By:"
205
  msgstr ""
206
 
207
- #: classes/class-woothemes-widget-features.php:181
208
  #@ woothemes-features
209
  msgid "Order Direction:"
210
  msgstr ""
211
 
212
- #: classes/class-woothemes-widget-features.php:190
213
  #@ woothemes-features
214
  msgid "Specific ID (optional):"
215
  msgstr ""
216
 
217
- #: classes/class-woothemes-widget-features.php:193
218
- #@ woothemes-features
219
- msgid "Display a specific testimonial, rather than a list."
220
- msgstr ""
221
-
222
- #: classes/class-woothemes-widget-features.php:204
223
  #@ woothemes-features
224
  msgid "No Order"
225
  msgstr ""
226
 
227
- #: classes/class-woothemes-widget-features.php:205
228
  #@ woothemes-features
229
  msgid "Entry ID"
230
  msgstr ""
231
 
232
- #: classes/class-woothemes-widget-features.php:206
233
  #@ woothemes-features
234
  msgid "Title"
235
  msgstr ""
236
 
237
- #: classes/class-woothemes-widget-features.php:207
238
  #@ woothemes-features
239
  msgid "Date Added"
240
  msgstr ""
241
 
242
- #: classes/class-woothemes-widget-features.php:208
243
  #@ woothemes-features
244
  msgid "Specified Order Setting"
245
  msgstr ""
246
 
247
- #: classes/class-woothemes-widget-features.php:219
248
  #@ woothemes-features
249
  msgid "Ascending"
250
  msgstr ""
251
 
252
- #: classes/class-woothemes-widget-features.php:220
253
  #@ woothemes-features
254
  msgid "Descending"
255
  msgstr ""
@@ -269,8 +260,13 @@ msgstr ""
269
  msgid "Enter a URL that applies to this feature (for example: http://woothemes.com/)."
270
  msgstr ""
271
 
272
- #: classes/class-woothemes-widget-features.php:167
273
  #@ woothemes-features
274
  msgid "Items Per Row:"
275
  msgstr ""
276
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: Features v1.2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2012-11-27 08:54:04+0000\n"
7
  "Last-Translator: Matt <matt@woothemes.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
46
  #: classes/class-woothemes-features.php:79
47
  #: classes/class-woothemes-features.php:80
48
  #: classes/class-woothemes-features.php:81
49
+ #: classes/class-woothemes-features.php:83
50
  #@ woothemes-features
51
  msgid "Feature"
52
  msgstr ""
85
  msgid "View %s"
86
  msgstr ""
87
 
 
 
 
 
 
88
  #: classes/class-woothemes-features.php:84
89
  #, php-format
90
  #@ woothemes-features
180
  msgid "Recent features listed on your site."
181
  msgstr ""
182
 
183
+ #: classes/class-woothemes-widget-features.php:156
184
  #@ woothemes-features
185
  msgid "Title (optional):"
186
  msgstr ""
187
 
188
+ #: classes/class-woothemes-widget-features.php:161
189
  #@ woothemes-features
190
  msgid "Limit:"
191
  msgstr ""
192
 
193
+ #: classes/class-woothemes-widget-features.php:166
194
  #@ woothemes-features
195
  msgid "Image Size (in pixels):"
196
  msgstr ""
197
 
198
+ #: classes/class-woothemes-widget-features.php:176
199
  #@ woothemes-features
200
  msgid "Order By:"
201
  msgstr ""
202
 
203
+ #: classes/class-woothemes-widget-features.php:185
204
  #@ woothemes-features
205
  msgid "Order Direction:"
206
  msgstr ""
207
 
208
+ #: classes/class-woothemes-widget-features.php:194
209
  #@ woothemes-features
210
  msgid "Specific ID (optional):"
211
  msgstr ""
212
 
213
+ #: classes/class-woothemes-widget-features.php:208
 
 
 
 
 
214
  #@ woothemes-features
215
  msgid "No Order"
216
  msgstr ""
217
 
218
+ #: classes/class-woothemes-widget-features.php:209
219
  #@ woothemes-features
220
  msgid "Entry ID"
221
  msgstr ""
222
 
223
+ #: classes/class-woothemes-widget-features.php:210
224
  #@ woothemes-features
225
  msgid "Title"
226
  msgstr ""
227
 
228
+ #: classes/class-woothemes-widget-features.php:211
229
  #@ woothemes-features
230
  msgid "Date Added"
231
  msgstr ""
232
 
233
+ #: classes/class-woothemes-widget-features.php:212
234
  #@ woothemes-features
235
  msgid "Specified Order Setting"
236
  msgstr ""
237
 
238
+ #: classes/class-woothemes-widget-features.php:223
239
  #@ woothemes-features
240
  msgid "Ascending"
241
  msgstr ""
242
 
243
+ #: classes/class-woothemes-widget-features.php:224
244
  #@ woothemes-features
245
  msgid "Descending"
246
  msgstr ""
260
  msgid "Enter a URL that applies to this feature (for example: http://woothemes.com/)."
261
  msgstr ""
262
 
263
+ #: classes/class-woothemes-widget-features.php:171
264
  #@ woothemes-features
265
  msgid "Items Per Row:"
266
  msgstr ""
267
 
268
+ #: classes/class-woothemes-widget-features.php:197
269
+ #@ woothemes-features
270
+ msgid "Display a specific feature, rather than a list."
271
+ msgstr ""
272
+
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: woothemes, mattyza, jameskoster
3
  Donate link: http://woothemes.com/
4
  Tags: features, widget, shortcode, template-tag, services
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 features your company, product or service offers, using our shortc
14
 
15
  "Features by WooThemes" is a clean and easy-to-use features showcase management system for WordPress. Load in the features your product, company or services offers, and display them via a shortcode, widget or template tag on your website.
16
 
 
 
 
 
 
17
  == Usage ==
18
 
19
  To display your features via a theme or a custom plugin, please use the following code:
@@ -31,11 +36,46 @@ To add arguments to this, please use any of the following arguments, using the s
31
  * 'per_row' => 3 (when creating rows, how many items display in a single row?)
32
  * 'link_title' => true (link the feature's title to it's permalink)
33
  * 'title' => '' (an optional title)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  `<?php do_action( 'woothemes_features', array( 'limit' => 10, 'link_title' => false ) ); ?>`
36
 
37
  The same arguments apply to the shortcode which is `[woothemes_features]` and the template tag, which is `<?php woothemes_features(); ?>`.
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  == Installation ==
40
 
41
  Installing "Features by WooThemes" can be done either by searching for "Features by WooThemes" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
@@ -61,6 +101,12 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi
61
 
62
  == Upgrade Notice ==
63
 
 
 
 
 
 
 
64
  = 1.1.0 =
65
  * Adds "URL" custom field.
66
  * Adds "link_title" option to the shortcode.
@@ -71,6 +117,15 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi
71
 
72
  == Changelog ==
73
 
 
 
 
 
 
 
 
 
 
74
  = 1.1.0 =
75
  * 2012-11-08
76
  * Adds "link_title" option to the shortcode.
3
  Donate link: http://woothemes.com/
4
  Tags: features, widget, shortcode, template-tag, services
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
  "Features by WooThemes" is a clean and easy-to-use features showcase management system for WordPress. Load in the features your product, company or services offers, and display them 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/features-by-woothemes/other_notes/).
18
+
19
+ Looking to contribute code to this plugin? [Fork the repository over at GitHub](http://github.com/woothemes/features/).
20
+ (submit pull requests to the "develop" branch)
21
+
22
  == Usage ==
23
 
24
  To display your features via a theme or a custom plugin, please use the following code:
36
  * 'per_row' => 3 (when creating rows, how many items display in a single row?)
37
  * 'link_title' => true (link the feature's title to it's permalink)
38
  * 'title' => '' (an optional title)
39
+ * 'before' => '&lt;div class="widget widget_woothemes_features"&gt;' (the starting HTML, wrapping the features)
40
+ * 'after' => '&lt;/div&gt;' (the ending HTML, wrapping the features)
41
+ * 'before_title' => '&lt;h2&gt;' (the starting HTML, wrapping the title)
42
+ * 'after_title' => '&lt;/h2&gt;' (the ending HTML, wrapping the title)
43
+
44
+ The various options for the "orderby" parameter are:
45
+
46
+ * 'none'
47
+ * 'ID'
48
+ * 'author'
49
+ * 'title'
50
+ * 'date'
51
+ * 'modified'
52
+ * 'parent'
53
+ * 'rand'
54
+ * 'comment_count'
55
+ * 'menu_order'
56
+ * 'meta_value'
57
+ * 'meta_value_num'
58
 
59
  `<?php do_action( 'woothemes_features', array( 'limit' => 10, 'link_title' => false ) ); ?>`
60
 
61
  The same arguments apply to the shortcode which is `[woothemes_features]` and the template tag, which is `<?php woothemes_features(); ?>`.
62
 
63
+ == Usage Examples ==
64
+
65
+ Adjusting the limit and image dimension, using the arguments in the three possible methods:
66
+
67
+ do_action() call:
68
+
69
+ `<?php do_action( 'woothemes_features', array( 'limit' => 10, 'size' => 100 ) ); ?>`
70
+
71
+ woothemes_features() template tag:
72
+
73
+ `<?php woothemes_features( array( 'limit' => 10, 'size' => 100 ) ); ?>`
74
+
75
+ [woothemes_features] shortcode:
76
+
77
+ `[woothemes_features limit="10" size="100"]`
78
+
79
  == Installation ==
80
 
81
  Installing "Features by WooThemes" can be done either by searching for "Features by WooThemes" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
101
 
102
  == Upgrade Notice ==
103
 
104
+ = 1.2.0 =
105
+ * Adds basic WPML support.
106
+ * Enhancements to the widget output.
107
+ * Adds new arguments for controlling the HTML wrapping the features, as well as wrapping the title.
108
+ * Ads support for the excerpt.
109
+
110
  = 1.1.0 =
111
  * Adds "URL" custom field.
112
  * Adds "link_title" option to the shortcode.
117
 
118
  == Changelog ==
119
 
120
+ = 1.2.0 =
121
+ * 2012-11-27
122
+ * Adds basic WPML support to the get_features() method.
123
+ * Moves the "title" outside of the ".features" DIV tag.
124
+ * 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.
125
+ * If the "link title" option is enabled, link the image as well.
126
+ * 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.
127
+ * Adds support for the excerpt.
128
+
129
  = 1.1.0 =
130
  * 2012-11-08
131
  * Adds "link_title" option to the shortcode.
woothemes-features-template.php CHANGED
@@ -40,7 +40,11 @@ function woothemes_features ( $args = '' ) {
40
  'size' => 50,
41
  'per_row' => 3,
42
  'link_title' => true,
43
- 'title' => ''
 
 
 
 
44
  );
45
 
46
  $args = wp_parse_args( $args, $defaults );
@@ -56,12 +60,13 @@ function woothemes_features ( $args = '' ) {
56
 
57
  // The Display.
58
  if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
59
- $html .= '<div class="widget widget_woothemes_features">' . "\n";
60
- $html .= '<div class="features">' . "\n";
61
-
62
  if ( '' != $args['title'] ) {
63
- $html .= '<h2>' . esc_html( $args['title'] ) . '</h2>' . "\n";
64
  }
 
 
65
 
66
  // Begin templating logic.
67
  $tpl = '<div class="%%CLASS%%">%%IMAGE%%<h3 class="feature-title">%%TITLE%%</h3><div class="feature-content">%%CONTENT%%</div></div>';
@@ -85,6 +90,7 @@ function woothemes_features ( $args = '' ) {
85
 
86
  $title = get_the_title();
87
  if ( true == $args['link_title'] ) {
 
88
  $title = '<a href="' . esc_url( $post->url ) . '" title="' . esc_attr( $title ) . '">' . $title . '</a>';
89
  }
90
 
@@ -97,7 +103,12 @@ function woothemes_features ( $args = '' ) {
97
 
98
  $template = str_replace( '%%CLASS%%', $class, $template );
99
  $template = str_replace( '%%TITLE%%', $title, $template );
100
- $template = str_replace( '%%CONTENT%%', get_the_content(), $template );
 
 
 
 
 
101
 
102
  $html .= $template;
103
 
@@ -107,7 +118,7 @@ function woothemes_features ( $args = '' ) {
107
  }
108
 
109
  $html .= '</div><!--/.features-->' . "\n";
110
- $html .= '</div><!--/.widget widget_woothemes_features-->' . "\n";
111
 
112
  wp_reset_postdata();
113
  }
40
  'size' => 50,
41
  'per_row' => 3,
42
  'link_title' => true,
43
+ 'title' => '',
44
+ 'before' => '<div class="widget widget_woothemes_features">',
45
+ 'after' => '</div><!--/.widget widget_woothemes_features-->',
46
+ 'before_title' => '<h2>',
47
+ 'after_title' => '</h2>'
48
  );
49
 
50
  $args = wp_parse_args( $args, $defaults );
60
 
61
  // The Display.
62
  if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
63
+ $html .= $args['before'] . "\n";
64
+
 
65
  if ( '' != $args['title'] ) {
66
+ $html .= $args['before_title'] . esc_html( $args['title'] ) . $args['after_title'] . "\n";
67
  }
68
+
69
+ $html .= '<div class="features">' . "\n";
70
 
71
  // Begin templating logic.
72
  $tpl = '<div class="%%CLASS%%">%%IMAGE%%<h3 class="feature-title">%%TITLE%%</h3><div class="feature-content">%%CONTENT%%</div></div>';
90
 
91
  $title = get_the_title();
92
  if ( true == $args['link_title'] ) {
93
+ $post->image = '<a href="' . esc_url( $post->url ) . '" title="' . esc_attr( $title ) . '">' . $post->image . '</a>';
94
  $title = '<a href="' . esc_url( $post->url ) . '" title="' . esc_attr( $title ) . '">' . $title . '</a>';
95
  }
96
 
103
 
104
  $template = str_replace( '%%CLASS%%', $class, $template );
105
  $template = str_replace( '%%TITLE%%', $title, $template );
106
+
107
+ if ( '' != get_the_excerpt() ) {
108
+ $template = str_replace( '%%CONTENT%%', get_the_excerpt(), $template );
109
+ } else {
110
+ $template = str_replace( '%%CONTENT%%', get_the_content(), $template );
111
+ }
112
 
113
  $html .= $template;
114
 
118
  }
119
 
120
  $html .= '</div><!--/.features-->' . "\n";
121
+ $html .= $args['after'] . "\n";
122
 
123
  wp_reset_postdata();
124
  }
woothemes-features.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://woothemes.com/
5
  * Description: Hi, I'm your feature showcase plugin for WordPress. Show off what features your company, product or service offers, 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
4
  * Plugin URI: http://woothemes.com/
5
  * Description: Hi, I'm your feature showcase plugin for WordPress. Show off what features your company, product or service offers, 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