Features by WooThemes - Version 1.1.0

Version Description

  • Adds "URL" custom field.
  • Adds "link_title" option to the shortcode.
  • Routine plugin maintenance.
Download this release

Release Info

Developer woothemes
Plugin Icon wp plugin Features by WooThemes
Version 1.1.0
Comparing to
See all releases

Code changes from version 1.0.0 to 1.1.0

classes/class-woothemes-features.php CHANGED
@@ -45,6 +45,8 @@ class Woothemes_Features {
45
  if ( is_admin() ) {
46
  global $pagenow;
47
 
 
 
48
  add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ) );
49
  add_action( 'admin_print_styles', array( &$this, 'enqueue_admin_styles' ), 10 );
50
  add_filter( 'post_updated_messages', array( &$this, 'updated_messages' ) );
@@ -195,6 +197,103 @@ class Woothemes_Features {
195
  return $messages;
196
  } // End updated_messages()
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  /**
199
  * Customise the "Enter title here" text.
200
  *
@@ -222,6 +321,25 @@ class Woothemes_Features {
222
  wp_enqueue_style( 'woothemes-features-admin' );
223
  } // End enqueue_admin_styles()
224
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  /**
226
  * Get the image for the given ID.
227
  * @param int $id Post ID.
@@ -309,6 +427,13 @@ class Woothemes_Features {
309
 
310
  // Get the image.
311
  $query[$k]->image = $this->get_image( $v->ID, $args['size'] );
 
 
 
 
 
 
 
312
  }
313
  } else {
314
  $query = false;
45
  if ( is_admin() ) {
46
  global $pagenow;
47
 
48
+ add_action( 'admin_menu', array( &$this, 'meta_box_setup' ), 20 );
49
+ add_action( 'save_post', array( &$this, 'meta_box_save' ) );
50
  add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ) );
51
  add_action( 'admin_print_styles', array( &$this, 'enqueue_admin_styles' ), 10 );
52
  add_filter( 'post_updated_messages', array( &$this, 'updated_messages' ) );
197
  return $messages;
198
  } // End updated_messages()
199
 
200
+ /**
201
+ * Setup the meta box.
202
+ *
203
+ * @access public
204
+ * @since 1.1.0
205
+ * @return void
206
+ */
207
+ public function meta_box_setup () {
208
+ add_meta_box( 'feature-data', __( 'Feature Details', 'woothemes-features' ), array( &$this, 'meta_box_content' ), $this->token, 'normal', 'high' );
209
+ } // End meta_box_setup()
210
+
211
+ /**
212
+ * The contents of our meta box.
213
+ *
214
+ * @access public
215
+ * @since 1.1.0
216
+ * @return void
217
+ */
218
+ public function meta_box_content () {
219
+ global $post_id;
220
+ $fields = get_post_custom( $post_id );
221
+ $field_data = $this->get_custom_fields_settings();
222
+
223
+ $html = '';
224
+
225
+ $html .= '<input type="hidden" name="woo_' . $this->token . '_noonce" id="woo_' . $this->token . '_noonce" value="' . wp_create_nonce( plugin_basename( $this->dir ) ) . '" />';
226
+
227
+ if ( 0 < count( $field_data ) ) {
228
+ $html .= '<table class="form-table">' . "\n";
229
+ $html .= '<tbody>' . "\n";
230
+
231
+ foreach ( $field_data as $k => $v ) {
232
+ $data = $v['default'];
233
+ if ( isset( $fields['_' . $k] ) && isset( $fields['_' . $k][0] ) ) {
234
+ $data = $fields['_' . $k][0];
235
+ }
236
+
237
+ $html .= '<tr valign="top"><th scope="row"><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td><input name="' . esc_attr( $k ) . '" type="text" id="' . esc_attr( $k ) . '" class="regular-text" value="' . esc_attr( $data ) . '" />' . "\n";
238
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
239
+ $html .= '</td><tr/>' . "\n";
240
+ }
241
+
242
+ $html .= '</tbody>' . "\n";
243
+ $html .= '</table>' . "\n";
244
+ }
245
+
246
+ echo $html;
247
+ } // End meta_box_content()
248
+
249
+ /**
250
+ * Save meta box fields.
251
+ *
252
+ * @access public
253
+ * @since 1.1.0
254
+ * @param int $post_id
255
+ * @return void
256
+ */
257
+ public function meta_box_save ( $post_id ) {
258
+ global $post, $messages;
259
+
260
+ // Verify
261
+ if ( ( get_post_type() != $this->token ) || ! wp_verify_nonce( $_POST['woo_' . $this->token . '_noonce'], plugin_basename( $this->dir ) ) ) {
262
+ return $post_id;
263
+ }
264
+
265
+ if ( 'page' == $_POST['post_type'] ) {
266
+ if ( ! current_user_can( 'edit_page', $post_id ) ) {
267
+ return $post_id;
268
+ }
269
+ } else {
270
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
271
+ return $post_id;
272
+ }
273
+ }
274
+
275
+ $field_data = $this->get_custom_fields_settings();
276
+ $fields = array_keys( $field_data );
277
+
278
+ foreach ( $fields as $f ) {
279
+
280
+ ${$f} = strip_tags(trim($_POST[$f]));
281
+
282
+ // Escape the URLs.
283
+ if ( 'url' == $field_data[$f]['type'] ) {
284
+ ${$f} = esc_url( ${$f} );
285
+ }
286
+
287
+ if ( get_post_meta( $post_id, '_' . $f ) == '' ) {
288
+ add_post_meta( $post_id, '_' . $f, ${$f}, true );
289
+ } elseif( ${$f} != get_post_meta( $post_id, '_' . $f, true ) ) {
290
+ update_post_meta( $post_id, '_' . $f, ${$f} );
291
+ } elseif ( ${$f} == '' ) {
292
+ delete_post_meta( $post_id, '_' . $f, get_post_meta( $post_id, '_' . $f, true ) );
293
+ }
294
+ }
295
+ } // End meta_box_save()
296
+
297
  /**
298
  * Customise the "Enter title here" text.
299
  *
321
  wp_enqueue_style( 'woothemes-features-admin' );
322
  } // End enqueue_admin_styles()
323
 
324
+ /**
325
+ * Get the settings for the custom fields.
326
+ * @since 1.1.0
327
+ * @return array
328
+ */
329
+ public function get_custom_fields_settings () {
330
+ $fields = array();
331
+
332
+ $fields['url'] = array(
333
+ 'name' => __( 'URL', 'woothemes-features' ),
334
+ 'description' => __( 'Enter a URL that applies to this feature (for example: http://woothemes.com/).', 'woothemes-features' ),
335
+ 'type' => 'url',
336
+ 'default' => '',
337
+ 'section' => 'info'
338
+ );
339
+
340
+ return $fields;
341
+ } // End get_custom_fields_settings()
342
+
343
  /**
344
  * Get the image for the given ID.
345
  * @param int $id Post ID.
427
 
428
  // Get the image.
429
  $query[$k]->image = $this->get_image( $v->ID, $args['size'] );
430
+
431
+ // Get the URL.
432
+ if ( isset( $meta['_url'][0] ) && '' != $meta['_url'][0] ) {
433
+ $query[$k]->url = esc_url( $meta['_url'][0] );
434
+ } else {
435
+ $query[$k]->url = get_permalink( $v->ID );
436
+ }
437
  }
438
  } else {
439
  $query = false;
lang/woothemes-features-en_GB.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Features v1.0.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2012-10-17 12:43:43+0000\n"
7
  "Last-Translator: Matt <matt@woothemes.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -19,162 +19,162 @@ msgstr ""
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
- #: classes/class-woothemes-features.php:74
23
  #@ woothemes-features
24
  msgctxt "post type general name"
25
  msgid "Features"
26
  msgstr ""
27
 
28
- #: classes/class-woothemes-features.php:75
29
  #@ woothemes-features
30
  msgctxt "post type singular name"
31
  msgid "Feature"
32
  msgstr ""
33
 
34
- #: classes/class-woothemes-features.php:76
35
  #@ woothemes-features
36
  msgctxt "feature"
37
  msgid "Add New"
38
  msgstr ""
39
 
40
- #: classes/class-woothemes-features.php:77
41
  #, php-format
42
  #@ woothemes-features
43
  msgid "Add New %s"
44
  msgstr ""
45
 
46
- #: classes/class-woothemes-features.php:77
47
- #: classes/class-woothemes-features.php:78
48
  #: classes/class-woothemes-features.php:79
 
 
49
  #@ woothemes-features
50
  msgid "Feature"
51
  msgstr ""
52
 
53
- #: classes/class-woothemes-features.php:78
54
  #, php-format
55
  #@ woothemes-features
56
  msgid "Edit %s"
57
  msgstr ""
58
 
59
- #: classes/class-woothemes-features.php:79
60
  #, php-format
61
  #@ woothemes-features
62
  msgid "New %s"
63
  msgstr ""
64
 
65
- #: classes/class-woothemes-features.php:80
66
  #, php-format
67
  #@ woothemes-features
68
  msgid "All %s"
69
  msgstr ""
70
 
71
- #: classes/class-woothemes-features.php:80
72
  #: classes/class-woothemes-features.php:82
73
- #: classes/class-woothemes-features.php:83
74
  #: classes/class-woothemes-features.php:84
 
75
  #: classes/class-woothemes-features.php:86
 
76
  #: classes/class-woothemes-widget-features.php:44
77
  #@ woothemes-features
78
  msgid "Features"
79
  msgstr ""
80
 
81
- #: classes/class-woothemes-features.php:81
82
  #, php-format
83
  #@ woothemes-features
84
  msgid "View %s"
85
  msgstr ""
86
 
87
- #: classes/class-woothemes-features.php:81
88
  #@ woothemes-features
89
  msgid "Testimonial"
90
  msgstr ""
91
 
92
- #: classes/class-woothemes-features.php:82
93
  #, php-format
94
  #@ woothemes-features
95
  msgid "Search %a"
96
  msgstr ""
97
 
98
- #: classes/class-woothemes-features.php:83
99
  #, php-format
100
  #@ woothemes-features
101
  msgid "No %s Found"
102
  msgstr ""
103
 
104
- #: classes/class-woothemes-features.php:84
105
  #, php-format
106
  #@ woothemes-features
107
  msgid "No %s Found In Trash"
108
  msgstr ""
109
 
110
- #: classes/class-woothemes-features.php:146
111
  #@ woothemes-features
112
  msgid "Image"
113
  msgstr ""
114
 
115
- #: classes/class-woothemes-features.php:180
116
  #, php-format
117
  #@ woothemes-features
118
  msgid "Feature updated. %sView feature%s"
119
  msgstr ""
120
 
121
- #: classes/class-woothemes-features.php:181
122
  #@ woothemes-features
123
  msgid "Custom field updated."
124
  msgstr ""
125
 
126
- #: classes/class-woothemes-features.php:182
127
  #@ woothemes-features
128
  msgid "Custom field deleted."
129
  msgstr ""
130
 
131
- #: classes/class-woothemes-features.php:183
132
  #@ woothemes-features
133
  msgid "Feature updated."
134
  msgstr ""
135
 
136
  #. translators: %s: date and time of the revision
137
- #: classes/class-woothemes-features.php:185
138
  #, php-format
139
  #@ woothemes-features
140
  msgid "Feature restored to revision from %s"
141
  msgstr ""
142
 
143
- #: classes/class-woothemes-features.php:186
144
  #, php-format
145
  #@ woothemes-features
146
  msgid "Feature published. %sView feature%s"
147
  msgstr ""
148
 
149
- #: classes/class-woothemes-features.php:187
150
  #@ default
151
  msgid "Feature saved."
152
  msgstr ""
153
 
154
- #: classes/class-woothemes-features.php:188
155
  #, php-format
156
  #@ woothemes-features
157
  msgid "Feature submitted. %sPreview feature%s"
158
  msgstr ""
159
 
160
- #: classes/class-woothemes-features.php:189
161
  #, php-format
162
  #@ woothemes-features
163
  msgid "Feature scheduled for: %1$s. %2$sPreview feature%3$s"
164
  msgstr ""
165
 
166
- #: classes/class-woothemes-features.php:191
167
  #@ default
168
  msgid "M j, Y @ G:i"
169
  msgstr ""
170
 
171
- #: classes/class-woothemes-features.php:192
172
  #, php-format
173
  #@ woothemes-features
174
  msgid "Feature draft updated. %sPreview feature%s"
175
  msgstr ""
176
 
177
- #: classes/class-woothemes-features.php:208
178
  #@ woothemes-features
179
  msgid "Enter the feature title here"
180
  msgstr ""
@@ -184,73 +184,93 @@ msgstr ""
184
  msgid "Recent features listed on your site."
185
  msgstr ""
186
 
187
- #: classes/class-woothemes-widget-features.php:149
188
  #@ woothemes-features
189
  msgid "Title (optional):"
190
  msgstr ""
191
 
192
- #: classes/class-woothemes-widget-features.php:154
193
  #@ woothemes-features
194
  msgid "Limit:"
195
  msgstr ""
196
 
197
- #: classes/class-woothemes-widget-features.php:159
198
  #@ woothemes-features
199
  msgid "Image Size (in pixels):"
200
  msgstr ""
201
 
202
- #: classes/class-woothemes-widget-features.php:164
203
  #@ woothemes-features
204
  msgid "Order By:"
205
  msgstr ""
206
 
207
- #: classes/class-woothemes-widget-features.php:173
208
  #@ woothemes-features
209
  msgid "Order Direction:"
210
  msgstr ""
211
 
212
- #: classes/class-woothemes-widget-features.php:182
213
  #@ woothemes-features
214
  msgid "Specific ID (optional):"
215
  msgstr ""
216
 
217
- #: classes/class-woothemes-widget-features.php:185
218
  #@ woothemes-features
219
  msgid "Display a specific testimonial, rather than a list."
220
  msgstr ""
221
 
222
- #: classes/class-woothemes-widget-features.php:196
223
  #@ woothemes-features
224
  msgid "No Order"
225
  msgstr ""
226
 
227
- #: classes/class-woothemes-widget-features.php:197
228
  #@ woothemes-features
229
  msgid "Entry ID"
230
  msgstr ""
231
 
232
- #: classes/class-woothemes-widget-features.php:198
233
  #@ woothemes-features
234
  msgid "Title"
235
  msgstr ""
236
 
237
- #: classes/class-woothemes-widget-features.php:199
238
  #@ woothemes-features
239
  msgid "Date Added"
240
  msgstr ""
241
 
242
- #: classes/class-woothemes-widget-features.php:200
243
  #@ woothemes-features
244
  msgid "Specified Order Setting"
245
  msgstr ""
246
 
247
- #: classes/class-woothemes-widget-features.php:211
248
  #@ woothemes-features
249
  msgid "Ascending"
250
  msgstr ""
251
 
252
- #: classes/class-woothemes-widget-features.php:212
253
  #@ woothemes-features
254
  msgid "Descending"
255
  msgstr ""
256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
+ #: classes/class-woothemes-features.php:76
23
  #@ woothemes-features
24
  msgctxt "post type general name"
25
  msgid "Features"
26
  msgstr ""
27
 
28
+ #: classes/class-woothemes-features.php:77
29
  #@ woothemes-features
30
  msgctxt "post type singular name"
31
  msgid "Feature"
32
  msgstr ""
33
 
34
+ #: classes/class-woothemes-features.php:78
35
  #@ woothemes-features
36
  msgctxt "feature"
37
  msgid "Add New"
38
  msgstr ""
39
 
40
+ #: classes/class-woothemes-features.php:79
41
  #, php-format
42
  #@ woothemes-features
43
  msgid "Add New %s"
44
  msgstr ""
45
 
 
 
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 ""
52
 
53
+ #: classes/class-woothemes-features.php:80
54
  #, php-format
55
  #@ woothemes-features
56
  msgid "Edit %s"
57
  msgstr ""
58
 
59
+ #: classes/class-woothemes-features.php:81
60
  #, php-format
61
  #@ woothemes-features
62
  msgid "New %s"
63
  msgstr ""
64
 
65
+ #: classes/class-woothemes-features.php:82
66
  #, php-format
67
  #@ woothemes-features
68
  msgid "All %s"
69
  msgstr ""
70
 
 
71
  #: classes/class-woothemes-features.php:82
 
72
  #: classes/class-woothemes-features.php:84
73
+ #: classes/class-woothemes-features.php:85
74
  #: classes/class-woothemes-features.php:86
75
+ #: classes/class-woothemes-features.php:88
76
  #: classes/class-woothemes-widget-features.php:44
77
  #@ woothemes-features
78
  msgid "Features"
79
  msgstr ""
80
 
81
+ #: classes/class-woothemes-features.php:83
82
  #, php-format
83
  #@ woothemes-features
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
95
  msgid "Search %a"
96
  msgstr ""
97
 
98
+ #: classes/class-woothemes-features.php:85
99
  #, php-format
100
  #@ woothemes-features
101
  msgid "No %s Found"
102
  msgstr ""
103
 
104
+ #: classes/class-woothemes-features.php:86
105
  #, php-format
106
  #@ woothemes-features
107
  msgid "No %s Found In Trash"
108
  msgstr ""
109
 
110
+ #: classes/class-woothemes-features.php:148
111
  #@ woothemes-features
112
  msgid "Image"
113
  msgstr ""
114
 
115
+ #: classes/class-woothemes-features.php:182
116
  #, php-format
117
  #@ woothemes-features
118
  msgid "Feature updated. %sView feature%s"
119
  msgstr ""
120
 
121
+ #: classes/class-woothemes-features.php:183
122
  #@ woothemes-features
123
  msgid "Custom field updated."
124
  msgstr ""
125
 
126
+ #: classes/class-woothemes-features.php:184
127
  #@ woothemes-features
128
  msgid "Custom field deleted."
129
  msgstr ""
130
 
131
+ #: classes/class-woothemes-features.php:185
132
  #@ woothemes-features
133
  msgid "Feature updated."
134
  msgstr ""
135
 
136
  #. translators: %s: date and time of the revision
137
+ #: classes/class-woothemes-features.php:187
138
  #, php-format
139
  #@ woothemes-features
140
  msgid "Feature restored to revision from %s"
141
  msgstr ""
142
 
143
+ #: classes/class-woothemes-features.php:188
144
  #, php-format
145
  #@ woothemes-features
146
  msgid "Feature published. %sView feature%s"
147
  msgstr ""
148
 
149
+ #: classes/class-woothemes-features.php:189
150
  #@ default
151
  msgid "Feature saved."
152
  msgstr ""
153
 
154
+ #: classes/class-woothemes-features.php:190
155
  #, php-format
156
  #@ woothemes-features
157
  msgid "Feature submitted. %sPreview feature%s"
158
  msgstr ""
159
 
160
+ #: classes/class-woothemes-features.php:191
161
  #, php-format
162
  #@ woothemes-features
163
  msgid "Feature scheduled for: %1$s. %2$sPreview feature%3$s"
164
  msgstr ""
165
 
166
+ #: classes/class-woothemes-features.php:193
167
  #@ default
168
  msgid "M j, Y @ G:i"
169
  msgstr ""
170
 
171
+ #: classes/class-woothemes-features.php:194
172
  #, php-format
173
  #@ woothemes-features
174
  msgid "Feature draft updated. %sPreview feature%s"
175
  msgstr ""
176
 
177
+ #: classes/class-woothemes-features.php:307
178
  #@ woothemes-features
179
  msgid "Enter the feature title here"
180
  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 ""
256
 
257
+ #: classes/class-woothemes-features.php:208
258
+ #@ woothemes-features
259
+ msgid "Feature Details"
260
+ msgstr ""
261
+
262
+ #: classes/class-woothemes-features.php:333
263
+ #@ woothemes-features
264
+ msgid "URL"
265
+ msgstr ""
266
+
267
+ #: classes/class-woothemes-features.php:334
268
+ #@ woothemes-features
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
+
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,7 +14,7 @@ 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:
20
 
@@ -61,10 +61,25 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi
61
 
62
  == Upgrade Notice ==
63
 
 
 
 
 
 
64
  = 1.0.0 =
65
  * Initial release. Woo!
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
 
 
 
 
69
  = 1.0.0 =
 
70
  * Initial release. Woo!
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
 
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:
20
 
61
 
62
  == Upgrade Notice ==
63
 
64
+ = 1.1.0 =
65
+ * Adds "URL" custom field.
66
+ * Adds "link_title" option to the shortcode.
67
+ * Routine plugin maintenance.
68
+
69
  = 1.0.0 =
70
  * Initial release. Woo!
71
 
72
  == Changelog ==
73
 
74
+ = 1.1.0 =
75
+ * 2012-11-08
76
+ * Adds "link_title" option to the shortcode.
77
+ * Adds "URL" custom field, to use in place of linking to the permalink, if it is specified.
78
+
79
+ = 1.0.1 =
80
+ * 2012-11-06
81
+ * Tweak - first / last classes applied regardless
82
+
83
  = 1.0.0 =
84
+ * 2012-10-23
85
  * Initial release. Woo!
woothemes-features-template.php CHANGED
@@ -76,16 +76,16 @@ function woothemes_features ( $args = '' ) {
76
 
77
  $class = 'feature';
78
 
79
- if ( count( $query ) == $i || ( 0 == $i % $args['per_row'] ) ) {
80
  $class .= ' last';
81
- } elseif ( 0 == ( $i - 1 ) % $args['per_row'] && count( $query ) != $i ) {
82
  $class .= ' first';
83
  }
84
 
85
 
86
  $title = get_the_title();
87
  if ( true == $args['link_title'] ) {
88
- $title = '<a href="' . esc_url( get_permalink( get_the_ID() ) ) . '" title="' . esc_attr( $title ) . '">' . $title . '</a>';
89
  }
90
 
91
  // Optionally display the image, if it is available.
@@ -135,7 +135,8 @@ function woothemes_features_shortcode ( $atts, $content = null ) {
135
  'id' => 0,
136
  'echo' => true,
137
  'size' => 50,
138
- 'per_row' => 3
 
139
  );
140
 
141
  $args = shortcode_atts( $defaults, $atts );
76
 
77
  $class = 'feature';
78
 
79
+ if( ( 0 == $i % $args['per_row'] ) ) {
80
  $class .= ' last';
81
+ } elseif ( 0 == ( $i - 1 ) % ( $args['per_row'] ) ) {
82
  $class .= ' first';
83
  }
84
 
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
 
91
  // Optionally display the image, if it is available.
135
  'id' => 0,
136
  'echo' => true,
137
  'size' => 50,
138
+ 'per_row' => 3,
139
+ 'link_title' => true
140
  );
141
 
142
  $args = shortcode_atts( $defaults, $atts );
woothemes-features.php CHANGED
@@ -4,11 +4,11 @@
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.0.0
8
  * Author URI: http://woothemes.com/
9
  *
10
  * @package WordPress
11
- * @subpackage WooThemes_Features
12
  * @author Matty
13
  * @since 1.0.0
14
  */
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
11
+ * @subpackage Woothemes_Features
12
  * @author Matty
13
  * @since 1.0.0
14
  */