Version Description
- Adds "woothemes_features_content" filter and shortcode support. Adds "feature-category" taxonomy.
Download this release
Release Info
Developer | mattyza |
Plugin | Features by WooThemes |
Version | 1.3.0 |
Comparing to | |
See all releases |
Code changes from version 1.2.2 to 1.3.0
- classes/class-woothemes-features-taxonomy.php +119 -0
- classes/class-woothemes-features.php +108 -75
- classes/class-woothemes-widget-features.php +36 -25
- lang/woothemes-features-en_GB.po +123 -50
- readme.txt +13 -2
- woothemes-features-template.php +59 -34
- woothemes-features.php +3 -1
classes/class-woothemes-features-taxonomy.php
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
|
3 |
+
|
4 |
+
/**
|
5 |
+
* WooThemes Features Taxonomy Class
|
6 |
+
*
|
7 |
+
* Re-usable class for registering feature taxonomies.
|
8 |
+
*
|
9 |
+
* @package WordPress
|
10 |
+
* @subpackage WooThemes_Features
|
11 |
+
* @category Plugin
|
12 |
+
* @author Matty
|
13 |
+
* @since 1.3.0
|
14 |
+
*/
|
15 |
+
class Woothemes_Features_Taxonomy {
|
16 |
+
/**
|
17 |
+
* The post type to register the taxonomy for.
|
18 |
+
* @access private
|
19 |
+
* @since 1.3.0
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
private $post_type;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The key of the taxonomy.
|
26 |
+
* @access private
|
27 |
+
* @since 1.3.0
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
private $token;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* The singular name for the taxonomy.
|
34 |
+
* @access private
|
35 |
+
* @since 1.3.0
|
36 |
+
* @var string
|
37 |
+
*/
|
38 |
+
private $singular;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* The plural name for the taxonomy.
|
42 |
+
* @access private
|
43 |
+
* @since 1.3.0
|
44 |
+
* @var string
|
45 |
+
*/
|
46 |
+
private $plural;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* The arguments to use when registering the taxonomy.
|
50 |
+
* @access private
|
51 |
+
* @since 1.3.0
|
52 |
+
* @var string
|
53 |
+
*/
|
54 |
+
private $args;
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Class constructor.
|
58 |
+
* @access public
|
59 |
+
* @since 1.3.0
|
60 |
+
* @param string $token The taxonomy key.
|
61 |
+
* @param string $singular Singular name.
|
62 |
+
* @param string $plural Plural name.
|
63 |
+
* @param array $args Array of argument overrides.
|
64 |
+
*/
|
65 |
+
public function __construct ( $token = 'feature-category', $singular = '', $plural = '', $args = array() ) {
|
66 |
+
$this->post_type = 'feature';
|
67 |
+
$this->token = esc_attr( $token );
|
68 |
+
$this->singular = esc_html( $singular );
|
69 |
+
$this->plural = esc_html( $plural );
|
70 |
+
|
71 |
+
if ( '' == $this->singular ) $this->singular = __( 'Category', 'woothemes-features' );
|
72 |
+
if ( '' == $this->plural ) $this->plural = __( 'Categories', 'woothemes-features' );
|
73 |
+
|
74 |
+
$this->args = wp_parse_args( $args, $this->_get_default_args() );
|
75 |
+
} // End __construct()
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Return an array of default arguments.
|
79 |
+
* @access private
|
80 |
+
* @since 1.3.0
|
81 |
+
* @return array Default arguments.
|
82 |
+
*/
|
83 |
+
private function _get_default_args () {
|
84 |
+
return array( 'labels' => $this->_get_default_labels(), 'public' => true, 'hierarchical' => true, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'show_in_nav_menus' => false, 'show_tagcloud' => false );
|
85 |
+
} // End _get_default_args()
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Return an array of default labels.
|
89 |
+
* @access private
|
90 |
+
* @since 1.3.0
|
91 |
+
* @return array Default labels.
|
92 |
+
*/
|
93 |
+
private function _get_default_labels () {
|
94 |
+
return array(
|
95 |
+
'name' => sprintf( _x( '%s', 'taxonomy general name', 'woothemes-features' ), $this->plural ),
|
96 |
+
'singular_name' => sprintf( _x( '%s', 'taxonomy singular name', 'woothemes-features' ), $this->singular ),
|
97 |
+
'search_items' => sprintf( __( 'Search %s', 'woothemes-features' ), $this->plural ),
|
98 |
+
'all_items' => sprintf( __( 'All %s', 'woothemes-features' ), $this->plural ),
|
99 |
+
'parent_item' => sprintf( __( 'Parent %s', 'woothemes-features' ), $this->singular ),
|
100 |
+
'parent_item_colon' => sprintf( __( 'Parent %s:', 'woothemes-features' ), $this->singular ),
|
101 |
+
'edit_item' => sprintf( __( 'Edit %s', 'woothemes-features' ), $this->singular ),
|
102 |
+
'update_item' => sprintf( __( 'Update %s', 'woothemes-features' ), $this->singular ),
|
103 |
+
'add_new_item' => sprintf( __( 'Add New %s', 'woothemes-features' ), $this->singular ),
|
104 |
+
'new_item_name' => sprintf( __( 'New %s Name', 'woothemes-features' ), $this->singular ),
|
105 |
+
'menu_name' => sprintf( __( '%s', 'woothemes-features' ), $this->plural )
|
106 |
+
);
|
107 |
+
} // End _get_default_labels()
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Register the taxonomy.
|
111 |
+
* @access public
|
112 |
+
* @since 1.3.0
|
113 |
+
* @return void
|
114 |
+
*/
|
115 |
+
public function register () {
|
116 |
+
register_taxonomy( esc_attr( $this->token ), esc_attr( $this->post_type ), (array)$this->args );
|
117 |
+
} // End register()
|
118 |
+
} // End Class
|
119 |
+
?>
|
classes/class-woothemes-features.php
CHANGED
@@ -19,10 +19,11 @@ class Woothemes_Features {
|
|
19 |
private $token;
|
20 |
public $version;
|
21 |
private $file;
|
|
|
22 |
|
23 |
/**
|
24 |
* Constructor function.
|
25 |
-
*
|
26 |
* @access public
|
27 |
* @since 1.0.0
|
28 |
* @return void
|
@@ -35,35 +36,36 @@ class Woothemes_Features {
|
|
35 |
$this->token = 'feature';
|
36 |
|
37 |
$this->load_plugin_textdomain();
|
38 |
-
add_action( 'init', array(
|
39 |
|
40 |
// Run this on activation.
|
41 |
-
register_activation_hook( $this->file, array(
|
42 |
|
43 |
-
add_action( 'init', array(
|
|
|
44 |
|
45 |
if ( is_admin() ) {
|
46 |
global $pagenow;
|
47 |
|
48 |
-
add_action( 'admin_menu', array(
|
49 |
-
add_action( 'save_post', array(
|
50 |
-
add_filter( 'enter_title_here', array(
|
51 |
-
add_action( 'admin_print_styles', array(
|
52 |
-
add_filter( 'post_updated_messages', array(
|
53 |
|
54 |
if ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && esc_attr( $_GET['post_type'] ) == $this->token ) {
|
55 |
-
add_filter( 'manage_edit-' . $this->token . '_columns', array(
|
56 |
-
add_action( 'manage_posts_custom_column', array(
|
57 |
}
|
58 |
}
|
59 |
|
60 |
-
add_action( 'after_setup_theme', array(
|
61 |
-
add_action( 'after_theme_setup', array(
|
62 |
} // End __construct()
|
63 |
|
64 |
/**
|
65 |
* Register the post type.
|
66 |
-
*
|
67 |
* @access public
|
68 |
* @param string $token
|
69 |
* @param string 'Features'
|
@@ -99,16 +101,27 @@ class Woothemes_Features {
|
|
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 |
);
|
106 |
register_post_type( $this->token, $args );
|
107 |
} // End register_post_type()
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
/**
|
110 |
* Add custom columns for the "manage" screen of this post type.
|
111 |
-
*
|
112 |
* @access public
|
113 |
* @param string $column_name
|
114 |
* @param int $id
|
@@ -117,11 +130,11 @@ class Woothemes_Features {
|
|
117 |
*/
|
118 |
public function register_custom_columns ( $column_name, $id ) {
|
119 |
global $wpdb, $post;
|
120 |
-
|
121 |
$meta = get_post_custom( $id );
|
122 |
|
123 |
switch ( $column_name ) {
|
124 |
-
|
125 |
case 'image':
|
126 |
$value = '';
|
127 |
|
@@ -132,13 +145,13 @@ class Woothemes_Features {
|
|
132 |
|
133 |
default:
|
134 |
break;
|
135 |
-
|
136 |
}
|
137 |
} // End register_custom_columns()
|
138 |
-
|
139 |
/**
|
140 |
* Add custom column headings for the "manage" screen of this post type.
|
141 |
-
*
|
142 |
* @access public
|
143 |
* @param array $defaults
|
144 |
* @since 1.0.0
|
@@ -146,25 +159,25 @@ class Woothemes_Features {
|
|
146 |
*/
|
147 |
public function register_custom_column_headings ( $defaults ) {
|
148 |
$new_columns = array( 'image' => __( 'Image', 'woothemes-features' ) );
|
149 |
-
|
150 |
$last_item = '';
|
151 |
|
152 |
if ( isset( $defaults['date'] ) ) { unset( $defaults['date'] ); }
|
153 |
|
154 |
-
if ( count( $defaults ) > 2 ) {
|
155 |
$last_item = array_slice( $defaults, -1 );
|
156 |
|
157 |
array_pop( $defaults );
|
158 |
}
|
159 |
$defaults = array_merge( $defaults, $new_columns );
|
160 |
-
|
161 |
if ( $last_item != '' ) {
|
162 |
foreach ( $last_item as $k => $v ) {
|
163 |
$defaults[$k] = $v;
|
164 |
break;
|
165 |
}
|
166 |
}
|
167 |
-
|
168 |
return $defaults;
|
169 |
} // End register_custom_column_headings()
|
170 |
|
@@ -199,18 +212,18 @@ class Woothemes_Features {
|
|
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(
|
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
|
@@ -221,9 +234,9 @@ class Woothemes_Features {
|
|
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";
|
@@ -242,13 +255,13 @@ class Woothemes_Features {
|
|
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
|
@@ -258,45 +271,45 @@ class Woothemes_Features {
|
|
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 |
-
*
|
300 |
* @access public
|
301 |
* @since 1.0.0
|
302 |
* @param string $title
|
@@ -311,7 +324,7 @@ class Woothemes_Features {
|
|
311 |
|
312 |
/**
|
313 |
* Enqueue post type admin CSS.
|
314 |
-
*
|
315 |
* @access public
|
316 |
* @since 1.0.0
|
317 |
* @return void
|
@@ -330,10 +343,10 @@ class Woothemes_Features {
|
|
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 |
|
@@ -369,7 +382,7 @@ class Woothemes_Features {
|
|
369 |
* @return void
|
370 |
*/
|
371 |
public function register_image_sizes () {
|
372 |
-
if ( function_exists( 'add_image_size' ) ) {
|
373 |
add_image_size( 'feature-thumbnail', 150, 9999 ); // 150 pixels wide (and unlimited height)
|
374 |
}
|
375 |
} // End register_image_sizes()
|
@@ -382,17 +395,18 @@ class Woothemes_Features {
|
|
382 |
*/
|
383 |
public function get_features ( $args = '' ) {
|
384 |
$defaults = array(
|
385 |
-
'limit' => 5,
|
386 |
-
'orderby' => 'menu_order',
|
387 |
-
'order' => 'DESC',
|
388 |
-
'id' => 0
|
|
|
389 |
);
|
390 |
-
|
391 |
$args = wp_parse_args( $args, $defaults );
|
392 |
-
|
393 |
// Allow child themes/plugins to filter here.
|
394 |
$args = apply_filters( 'woothemes_get_features_args', $args );
|
395 |
-
|
396 |
// The Query Arguments.
|
397 |
$query_args = array();
|
398 |
$query_args['post_type'] = 'feature';
|
@@ -400,27 +414,46 @@ class Woothemes_Features {
|
|
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'] );
|
406 |
}
|
407 |
-
|
408 |
// Whitelist checks.
|
409 |
if ( ! in_array( $query_args['orderby'], array( 'none', 'ID', 'author', 'title', 'date', 'modified', 'parent', 'rand', 'comment_count', 'menu_order', 'meta_value', 'meta_value_num' ) ) ) {
|
410 |
$query_args['orderby'] = 'date';
|
411 |
}
|
412 |
-
|
413 |
if ( ! in_array( $query_args['order'], array( 'ASC', 'DESC' ) ) ) {
|
414 |
$query_args['order'] = 'DESC';
|
415 |
}
|
416 |
-
|
417 |
if ( ! in_array( $query_args['post_type'], get_post_types() ) ) {
|
418 |
$query_args['post_type'] = 'feature';
|
419 |
}
|
420 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
// The Query.
|
422 |
$query = get_posts( $query_args );
|
423 |
-
|
424 |
// The Display.
|
425 |
if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
|
426 |
foreach ( $query as $k => $v ) {
|
@@ -439,7 +472,7 @@ class Woothemes_Features {
|
|
439 |
} else {
|
440 |
$query = false;
|
441 |
}
|
442 |
-
|
443 |
return $query;
|
444 |
} // End get_features()
|
445 |
|
@@ -462,7 +495,7 @@ class Woothemes_Features {
|
|
462 |
$domain = 'woothemes-features';
|
463 |
// The "plugin_locale" filter is also used in load_plugin_textdomain()
|
464 |
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
|
465 |
-
|
466 |
load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
|
467 |
load_plugin_textdomain( $domain, FALSE, dirname( plugin_basename( $this->file ) ) . '/lang/' );
|
468 |
} // End load_plugin_textdomain()
|
19 |
private $token;
|
20 |
public $version;
|
21 |
private $file;
|
22 |
+
public $taxonomy_category;
|
23 |
|
24 |
/**
|
25 |
* Constructor function.
|
26 |
+
*
|
27 |
* @access public
|
28 |
* @since 1.0.0
|
29 |
* @return void
|
36 |
$this->token = 'feature';
|
37 |
|
38 |
$this->load_plugin_textdomain();
|
39 |
+
add_action( 'init', array( $this, 'load_localisation' ), 0 );
|
40 |
|
41 |
// Run this on activation.
|
42 |
+
register_activation_hook( $this->file, array( $this, 'activation' ) );
|
43 |
|
44 |
+
add_action( 'init', array( $this, 'register_post_type' ) );
|
45 |
+
add_action( 'init', array( $this, 'register_taxonomy' ) );
|
46 |
|
47 |
if ( is_admin() ) {
|
48 |
global $pagenow;
|
49 |
|
50 |
+
add_action( 'admin_menu', array( $this, 'meta_box_setup' ), 20 );
|
51 |
+
add_action( 'save_post', array( $this, 'meta_box_save' ) );
|
52 |
+
add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) );
|
53 |
+
add_action( 'admin_print_styles', array( $this, 'enqueue_admin_styles' ), 10 );
|
54 |
+
add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
|
55 |
|
56 |
if ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && esc_attr( $_GET['post_type'] ) == $this->token ) {
|
57 |
+
add_filter( 'manage_edit-' . $this->token . '_columns', array( $this, 'register_custom_column_headings' ), 10, 1 );
|
58 |
+
add_action( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
|
59 |
}
|
60 |
}
|
61 |
|
62 |
+
add_action( 'after_setup_theme', array( $this, 'ensure_post_thumbnails_support' ) );
|
63 |
+
add_action( 'after_theme_setup', array( $this, 'register_image_sizes' ) );
|
64 |
} // End __construct()
|
65 |
|
66 |
/**
|
67 |
* Register the post type.
|
68 |
+
*
|
69 |
* @access public
|
70 |
* @param string $token
|
71 |
* @param string 'Features'
|
101 |
'capability_type' => 'post',
|
102 |
'has_archive' => true,
|
103 |
'hierarchical' => false,
|
104 |
+
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes' ),
|
105 |
+
'menu_position' => 5,
|
106 |
'menu_icon' => ''
|
107 |
);
|
108 |
register_post_type( $this->token, $args );
|
109 |
} // End register_post_type()
|
110 |
|
111 |
+
/**
|
112 |
+
* Register the "feature-category" taxonomy.
|
113 |
+
* @access public
|
114 |
+
* @since 1.3.0
|
115 |
+
* @return void
|
116 |
+
*/
|
117 |
+
public function register_taxonomy () {
|
118 |
+
$this->taxonomy_category = new Woothemes_Features_Taxonomy(); // Leave arguments empty, to use the default arguments.
|
119 |
+
$this->taxonomy_category->register();
|
120 |
+
} // End register_taxonomy()
|
121 |
+
|
122 |
/**
|
123 |
* Add custom columns for the "manage" screen of this post type.
|
124 |
+
*
|
125 |
* @access public
|
126 |
* @param string $column_name
|
127 |
* @param int $id
|
130 |
*/
|
131 |
public function register_custom_columns ( $column_name, $id ) {
|
132 |
global $wpdb, $post;
|
133 |
+
|
134 |
$meta = get_post_custom( $id );
|
135 |
|
136 |
switch ( $column_name ) {
|
137 |
+
|
138 |
case 'image':
|
139 |
$value = '';
|
140 |
|
145 |
|
146 |
default:
|
147 |
break;
|
148 |
+
|
149 |
}
|
150 |
} // End register_custom_columns()
|
151 |
+
|
152 |
/**
|
153 |
* Add custom column headings for the "manage" screen of this post type.
|
154 |
+
*
|
155 |
* @access public
|
156 |
* @param array $defaults
|
157 |
* @since 1.0.0
|
159 |
*/
|
160 |
public function register_custom_column_headings ( $defaults ) {
|
161 |
$new_columns = array( 'image' => __( 'Image', 'woothemes-features' ) );
|
162 |
+
|
163 |
$last_item = '';
|
164 |
|
165 |
if ( isset( $defaults['date'] ) ) { unset( $defaults['date'] ); }
|
166 |
|
167 |
+
if ( count( $defaults ) > 2 ) {
|
168 |
$last_item = array_slice( $defaults, -1 );
|
169 |
|
170 |
array_pop( $defaults );
|
171 |
}
|
172 |
$defaults = array_merge( $defaults, $new_columns );
|
173 |
+
|
174 |
if ( $last_item != '' ) {
|
175 |
foreach ( $last_item as $k => $v ) {
|
176 |
$defaults[$k] = $v;
|
177 |
break;
|
178 |
}
|
179 |
}
|
180 |
+
|
181 |
return $defaults;
|
182 |
} // End register_custom_column_headings()
|
183 |
|
212 |
|
213 |
/**
|
214 |
* Setup the meta box.
|
215 |
+
*
|
216 |
* @access public
|
217 |
* @since 1.1.0
|
218 |
* @return void
|
219 |
*/
|
220 |
+
public function meta_box_setup () {
|
221 |
+
add_meta_box( 'feature-data', __( 'Feature Details', 'woothemes-features' ), array( $this, 'meta_box_content' ), $this->token, 'normal', 'high' );
|
222 |
} // End meta_box_setup()
|
223 |
+
|
224 |
/**
|
225 |
* The contents of our meta box.
|
226 |
+
*
|
227 |
* @access public
|
228 |
* @since 1.1.0
|
229 |
* @return void
|
234 |
$field_data = $this->get_custom_fields_settings();
|
235 |
|
236 |
$html = '';
|
237 |
+
|
238 |
$html .= '<input type="hidden" name="woo_' . $this->token . '_noonce" id="woo_' . $this->token . '_noonce" value="' . wp_create_nonce( plugin_basename( $this->dir ) ) . '" />';
|
239 |
+
|
240 |
if ( 0 < count( $field_data ) ) {
|
241 |
$html .= '<table class="form-table">' . "\n";
|
242 |
$html .= '<tbody>' . "\n";
|
255 |
$html .= '</tbody>' . "\n";
|
256 |
$html .= '</table>' . "\n";
|
257 |
}
|
258 |
+
|
259 |
+
echo $html;
|
260 |
} // End meta_box_content()
|
261 |
+
|
262 |
/**
|
263 |
* Save meta box fields.
|
264 |
+
*
|
265 |
* @access public
|
266 |
* @since 1.1.0
|
267 |
* @param int $post_id
|
271 |
global $post, $messages;
|
272 |
|
273 |
// Verify
|
274 |
+
if ( ( get_post_type() != $this->token ) || ! wp_verify_nonce( $_POST['woo_' . $this->token . '_noonce'], plugin_basename( $this->dir ) ) ) {
|
275 |
+
return $post_id;
|
276 |
}
|
277 |
+
|
278 |
+
if ( 'page' == $_POST['post_type'] ) {
|
279 |
+
if ( ! current_user_can( 'edit_page', $post_id ) ) {
|
280 |
return $post_id;
|
281 |
}
|
282 |
+
} else {
|
283 |
+
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
284 |
return $post_id;
|
285 |
}
|
286 |
}
|
287 |
+
|
288 |
$field_data = $this->get_custom_fields_settings();
|
289 |
$fields = array_keys( $field_data );
|
290 |
+
|
291 |
foreach ( $fields as $f ) {
|
292 |
+
|
293 |
${$f} = strip_tags(trim($_POST[$f]));
|
294 |
|
295 |
// Escape the URLs.
|
296 |
if ( 'url' == $field_data[$f]['type'] ) {
|
297 |
${$f} = esc_url( ${$f} );
|
298 |
}
|
299 |
+
|
300 |
+
if ( get_post_meta( $post_id, '_' . $f ) == '' ) {
|
301 |
+
add_post_meta( $post_id, '_' . $f, ${$f}, true );
|
302 |
+
} elseif( ${$f} != get_post_meta( $post_id, '_' . $f, true ) ) {
|
303 |
update_post_meta( $post_id, '_' . $f, ${$f} );
|
304 |
+
} elseif ( ${$f} == '' ) {
|
305 |
delete_post_meta( $post_id, '_' . $f, get_post_meta( $post_id, '_' . $f, true ) );
|
306 |
+
}
|
307 |
}
|
308 |
} // End meta_box_save()
|
309 |
|
310 |
/**
|
311 |
* Customise the "Enter title here" text.
|
312 |
+
*
|
313 |
* @access public
|
314 |
* @since 1.0.0
|
315 |
* @param string $title
|
324 |
|
325 |
/**
|
326 |
* Enqueue post type admin CSS.
|
327 |
+
*
|
328 |
* @access public
|
329 |
* @since 1.0.0
|
330 |
* @return void
|
343 |
$fields = array();
|
344 |
|
345 |
$fields['url'] = array(
|
346 |
+
'name' => __( 'URL', 'woothemes-features' ),
|
347 |
+
'description' => __( 'Enter a URL that applies to this feature (for example: http://woothemes.com/).', 'woothemes-features' ),
|
348 |
+
'type' => 'url',
|
349 |
+
'default' => '',
|
350 |
'section' => 'info'
|
351 |
);
|
352 |
|
382 |
* @return void
|
383 |
*/
|
384 |
public function register_image_sizes () {
|
385 |
+
if ( function_exists( 'add_image_size' ) ) {
|
386 |
add_image_size( 'feature-thumbnail', 150, 9999 ); // 150 pixels wide (and unlimited height)
|
387 |
}
|
388 |
} // End register_image_sizes()
|
395 |
*/
|
396 |
public function get_features ( $args = '' ) {
|
397 |
$defaults = array(
|
398 |
+
'limit' => 5,
|
399 |
+
'orderby' => 'menu_order',
|
400 |
+
'order' => 'DESC',
|
401 |
+
'id' => 0,
|
402 |
+
'category' => 0
|
403 |
);
|
404 |
+
|
405 |
$args = wp_parse_args( $args, $defaults );
|
406 |
+
|
407 |
// Allow child themes/plugins to filter here.
|
408 |
$args = apply_filters( 'woothemes_get_features_args', $args );
|
409 |
+
|
410 |
// The Query Arguments.
|
411 |
$query_args = array();
|
412 |
$query_args['post_type'] = 'feature';
|
414 |
$query_args['orderby'] = $args['orderby'];
|
415 |
$query_args['order'] = $args['order'];
|
416 |
$query_args['suppress_filters'] = 0;
|
417 |
+
|
418 |
if ( is_numeric( $args['id'] ) && ( intval( $args['id'] ) > 0 ) ) {
|
419 |
$query_args['p'] = intval( $args['id'] );
|
420 |
}
|
421 |
+
|
422 |
// Whitelist checks.
|
423 |
if ( ! in_array( $query_args['orderby'], array( 'none', 'ID', 'author', 'title', 'date', 'modified', 'parent', 'rand', 'comment_count', 'menu_order', 'meta_value', 'meta_value_num' ) ) ) {
|
424 |
$query_args['orderby'] = 'date';
|
425 |
}
|
426 |
+
|
427 |
if ( ! in_array( $query_args['order'], array( 'ASC', 'DESC' ) ) ) {
|
428 |
$query_args['order'] = 'DESC';
|
429 |
}
|
430 |
+
|
431 |
if ( ! in_array( $query_args['post_type'], get_post_types() ) ) {
|
432 |
$query_args['post_type'] = 'feature';
|
433 |
}
|
434 |
+
|
435 |
+
$tax_field_type = '';
|
436 |
+
|
437 |
+
// If the category ID is specified.
|
438 |
+
if ( is_numeric( $args['category'] ) && 0 < intval( $args['category'] ) ) {
|
439 |
+
$tax_field_type = 'id';
|
440 |
+
}
|
441 |
+
|
442 |
+
// If the category slug is specified.
|
443 |
+
if ( ! is_numeric( $args['category'] ) && is_string( $args['category'] ) ) {
|
444 |
+
$tax_field_type = 'slug';
|
445 |
+
}
|
446 |
+
|
447 |
+
// Setup the taxonomy query.
|
448 |
+
if ( '' != $tax_field_type ) {
|
449 |
+
$term = $args['category'];
|
450 |
+
if ( is_string( $term ) ) { $term = esc_html( $term ); } else { $term = intval( $term ); }
|
451 |
+
$query_args['tax_query'] = array( array( 'taxonomy' => 'feature-category', 'field' => $tax_field_type, 'terms' => array( $term ) ) );
|
452 |
+
}
|
453 |
+
|
454 |
// The Query.
|
455 |
$query = get_posts( $query_args );
|
456 |
+
|
457 |
// The Display.
|
458 |
if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
|
459 |
foreach ( $query as $k => $v ) {
|
472 |
} else {
|
473 |
$query = false;
|
474 |
}
|
475 |
+
|
476 |
return $query;
|
477 |
} // End get_features()
|
478 |
|
495 |
$domain = 'woothemes-features';
|
496 |
// The "plugin_locale" filter is also used in load_plugin_textdomain()
|
497 |
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
|
498 |
+
|
499 |
load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
|
500 |
load_plugin_textdomain( $domain, FALSE, dirname( plugin_basename( $this->file ) ) . '/lang/' );
|
501 |
} // End load_plugin_textdomain()
|
classes/class-woothemes-widget-features.php
CHANGED
@@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) || ! function_exists( 'woothemes_features' ) ) exit;
|
|
18 |
* protected $woothemes_widget_description
|
19 |
* protected $woothemes_widget_idbase
|
20 |
* protected $woothemes_widget_title
|
21 |
-
*
|
22 |
* - __construct()
|
23 |
* - widget()
|
24 |
* - update()
|
@@ -50,7 +50,7 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
50 |
$control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => $this->woothemes_widget_idbase );
|
51 |
|
52 |
/* Create the widget. */
|
53 |
-
$this->WP_Widget( $this->woothemes_widget_idbase, $this->woothemes_widget_title, $widget_ops, $control_ops );
|
54 |
} // End __construct()
|
55 |
|
56 |
/**
|
@@ -60,12 +60,12 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
60 |
* @param array $instance Widget settings for this instance.
|
61 |
* @return void
|
62 |
*/
|
63 |
-
public function widget( $args, $instance ) {
|
64 |
extract( $args, EXTR_SKIP );
|
65 |
-
|
66 |
/* Our variables from the widget settings. */
|
67 |
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base );
|
68 |
-
|
69 |
/* Before widget (defined by themes). */
|
70 |
$args = array();
|
71 |
|
@@ -80,7 +80,7 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
80 |
$args['before_title'] = $before_title;
|
81 |
$args['after_title'] = $after_title;
|
82 |
}
|
83 |
-
|
84 |
/* Widget content. */
|
85 |
// Add actions for plugins/themes to hook onto.
|
86 |
do_action( $this->woothemes_widget_cssclass . '_top' );
|
@@ -90,6 +90,7 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
90 |
if ( isset( $instance['specific_id'] ) && ( 0 < count( $instance['specific_id'] ) ) ) { $args['id'] = intval( $instance['specific_id'] ); }
|
91 |
if ( isset( $instance['size'] ) && ( 0 < count( $instance['size'] ) ) ) { $args['size'] = intval( $instance['size'] ); }
|
92 |
if ( isset( $instance['per_row'] ) && ( 0 < count( $instance['per_row'] ) ) ) { $args['per_row'] = intval( $instance['per_row'] ); }
|
|
|
93 |
|
94 |
// Select boxes.
|
95 |
if ( isset( $instance['orderby'] ) && in_array( $instance['orderby'], array_keys( $this->get_orderby_options() ) ) ) { $args['orderby'] = $instance['orderby']; }
|
@@ -120,6 +121,7 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
120 |
$instance['specific_id'] = intval( $new_instance['specific_id'] );
|
121 |
$instance['size'] = intval( $new_instance['size'] );
|
122 |
$instance['per_row'] = intval( $new_instance['per_row'] );
|
|
|
123 |
|
124 |
/* The select box is returning a text value, so we escape it. */
|
125 |
$instance['orderby'] = esc_attr( $new_instance['orderby'] );
|
@@ -135,20 +137,21 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
135 |
* @param array $instance The settings for this instance.
|
136 |
* @return void
|
137 |
*/
|
138 |
-
public function form( $instance ) {
|
139 |
-
|
140 |
/* Set up some default widget settings. */
|
141 |
/* Make sure all keys are added here, even with empty string values. */
|
142 |
$defaults = array(
|
143 |
-
'title' => '',
|
144 |
-
'limit' => 5,
|
145 |
-
'orderby' => 'menu_order',
|
146 |
-
'order' => 'DESC',
|
147 |
-
'specific_id' => '',
|
148 |
-
'size' => 50,
|
149 |
-
'per_row' => 3
|
|
|
150 |
);
|
151 |
-
|
152 |
$instance = wp_parse_args( (array) $instance, $defaults );
|
153 |
?>
|
154 |
<!-- Widget Title: Text Input -->
|
@@ -177,7 +180,7 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
177 |
<select name="<?php echo $this->get_field_name( 'orderby' ); ?>" class="widefat" id="<?php echo $this->get_field_id( 'orderby' ); ?>">
|
178 |
<?php foreach ( $this->get_orderby_options() as $k => $v ) { ?>
|
179 |
<option value="<?php echo $k; ?>"<?php selected( $instance['orderby'], $k ); ?>><?php echo $v; ?></option>
|
180 |
-
<?php } ?>
|
181 |
</select>
|
182 |
</p>
|
183 |
<!-- Widget Order: Select Input -->
|
@@ -186,9 +189,17 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
186 |
<select name="<?php echo $this->get_field_name( 'order' ); ?>" class="widefat" id="<?php echo $this->get_field_id( 'order' ); ?>">
|
187 |
<?php foreach ( $this->get_order_options() as $k => $v ) { ?>
|
188 |
<option value="<?php echo $k; ?>"<?php selected( $instance['order'], $k ); ?>><?php echo $v; ?></option>
|
189 |
-
<?php } ?>
|
190 |
</select>
|
191 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
<!-- Widget ID: Text Input -->
|
193 |
<p>
|
194 |
<label for="<?php echo $this->get_field_id( 'specific_id' ); ?>"><?php _e( 'Specific ID (optional):', 'woothemes-features' ); ?></label>
|
@@ -205,11 +216,11 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
205 |
*/
|
206 |
protected function get_orderby_options () {
|
207 |
return array(
|
208 |
-
'none' => __( 'No Order', 'woothemes-features' ),
|
209 |
-
'ID' => __( 'Entry ID', 'woothemes-features' ),
|
210 |
-
'title' => __( 'Title', 'woothemes-features' ),
|
211 |
-
'date' => __( 'Date Added', 'woothemes-features' ),
|
212 |
-
'menu_order' => __( 'Specified Order Setting', 'woothemes-features' ),
|
213 |
'rand' => __( 'Random Order', 'woothemes-features' )
|
214 |
);
|
215 |
} // End get_orderby_options()
|
@@ -221,12 +232,12 @@ class Woothemes_Widget_Features extends WP_Widget {
|
|
221 |
*/
|
222 |
protected function get_order_options () {
|
223 |
return array(
|
224 |
-
'ASC' => __( 'Ascending', 'woothemes-features' ),
|
225 |
'DESC' => __( 'Descending', 'woothemes-features' )
|
226 |
);
|
227 |
} // End get_order_options()
|
228 |
} // End Class
|
229 |
|
230 |
/* Register the widget. */
|
231 |
-
add_action( 'widgets_init', create_function( '', 'return register_widget("WooThemes_Widget_Features");' ), 1 );
|
232 |
?>
|
18 |
* protected $woothemes_widget_description
|
19 |
* protected $woothemes_widget_idbase
|
20 |
* protected $woothemes_widget_title
|
21 |
+
*
|
22 |
* - __construct()
|
23 |
* - widget()
|
24 |
* - update()
|
50 |
$control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => $this->woothemes_widget_idbase );
|
51 |
|
52 |
/* Create the widget. */
|
53 |
+
$this->WP_Widget( $this->woothemes_widget_idbase, $this->woothemes_widget_title, $widget_ops, $control_ops );
|
54 |
} // End __construct()
|
55 |
|
56 |
/**
|
60 |
* @param array $instance Widget settings for this instance.
|
61 |
* @return void
|
62 |
*/
|
63 |
+
public function widget( $args, $instance ) {
|
64 |
extract( $args, EXTR_SKIP );
|
65 |
+
|
66 |
/* Our variables from the widget settings. */
|
67 |
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base );
|
68 |
+
|
69 |
/* Before widget (defined by themes). */
|
70 |
$args = array();
|
71 |
|
80 |
$args['before_title'] = $before_title;
|
81 |
$args['after_title'] = $after_title;
|
82 |
}
|
83 |
+
|
84 |
/* Widget content. */
|
85 |
// Add actions for plugins/themes to hook onto.
|
86 |
do_action( $this->woothemes_widget_cssclass . '_top' );
|
90 |
if ( isset( $instance['specific_id'] ) && ( 0 < count( $instance['specific_id'] ) ) ) { $args['id'] = intval( $instance['specific_id'] ); }
|
91 |
if ( isset( $instance['size'] ) && ( 0 < count( $instance['size'] ) ) ) { $args['size'] = intval( $instance['size'] ); }
|
92 |
if ( isset( $instance['per_row'] ) && ( 0 < count( $instance['per_row'] ) ) ) { $args['per_row'] = intval( $instance['per_row'] ); }
|
93 |
+
if ( isset( $instance['category'] ) && is_numeric( $instance['category'] ) ) $args['category'] = intval( $instance['category'] );
|
94 |
|
95 |
// Select boxes.
|
96 |
if ( isset( $instance['orderby'] ) && in_array( $instance['orderby'], array_keys( $this->get_orderby_options() ) ) ) { $args['orderby'] = $instance['orderby']; }
|
121 |
$instance['specific_id'] = intval( $new_instance['specific_id'] );
|
122 |
$instance['size'] = intval( $new_instance['size'] );
|
123 |
$instance['per_row'] = intval( $new_instance['per_row'] );
|
124 |
+
$instance['category'] = intval( $new_instance['category'] );
|
125 |
|
126 |
/* The select box is returning a text value, so we escape it. */
|
127 |
$instance['orderby'] = esc_attr( $new_instance['orderby'] );
|
137 |
* @param array $instance The settings for this instance.
|
138 |
* @return void
|
139 |
*/
|
140 |
+
public function form( $instance ) {
|
141 |
+
|
142 |
/* Set up some default widget settings. */
|
143 |
/* Make sure all keys are added here, even with empty string values. */
|
144 |
$defaults = array(
|
145 |
+
'title' => '',
|
146 |
+
'limit' => 5,
|
147 |
+
'orderby' => 'menu_order',
|
148 |
+
'order' => 'DESC',
|
149 |
+
'specific_id' => '',
|
150 |
+
'size' => 50,
|
151 |
+
'per_row' => 3,
|
152 |
+
'category' => 0
|
153 |
);
|
154 |
+
|
155 |
$instance = wp_parse_args( (array) $instance, $defaults );
|
156 |
?>
|
157 |
<!-- Widget Title: Text Input -->
|
180 |
<select name="<?php echo $this->get_field_name( 'orderby' ); ?>" class="widefat" id="<?php echo $this->get_field_id( 'orderby' ); ?>">
|
181 |
<?php foreach ( $this->get_orderby_options() as $k => $v ) { ?>
|
182 |
<option value="<?php echo $k; ?>"<?php selected( $instance['orderby'], $k ); ?>><?php echo $v; ?></option>
|
183 |
+
<?php } ?>
|
184 |
</select>
|
185 |
</p>
|
186 |
<!-- Widget Order: Select Input -->
|
189 |
<select name="<?php echo $this->get_field_name( 'order' ); ?>" class="widefat" id="<?php echo $this->get_field_id( 'order' ); ?>">
|
190 |
<?php foreach ( $this->get_order_options() as $k => $v ) { ?>
|
191 |
<option value="<?php echo $k; ?>"<?php selected( $instance['order'], $k ); ?>><?php echo $v; ?></option>
|
192 |
+
<?php } ?>
|
193 |
</select>
|
194 |
</p>
|
195 |
+
<!-- Widget Category: Select Input -->
|
196 |
+
<p>
|
197 |
+
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Category:', 'woothemes-features' ); ?></label>
|
198 |
+
<?php
|
199 |
+
$dropdown_args = array( 'taxonomy' => 'feature-category', 'class' => 'widefat', 'show_option_all' => __( 'All', 'woothemes-features' ), 'id' => $this->get_field_id( 'category' ), 'name' => $this->get_field_name( 'category' ), 'selected' => $instance['category'] );
|
200 |
+
wp_dropdown_categories( $dropdown_args );
|
201 |
+
?>
|
202 |
+
</p>
|
203 |
<!-- Widget ID: Text Input -->
|
204 |
<p>
|
205 |
<label for="<?php echo $this->get_field_id( 'specific_id' ); ?>"><?php _e( 'Specific ID (optional):', 'woothemes-features' ); ?></label>
|
216 |
*/
|
217 |
protected function get_orderby_options () {
|
218 |
return array(
|
219 |
+
'none' => __( 'No Order', 'woothemes-features' ),
|
220 |
+
'ID' => __( 'Entry ID', 'woothemes-features' ),
|
221 |
+
'title' => __( 'Title', 'woothemes-features' ),
|
222 |
+
'date' => __( 'Date Added', 'woothemes-features' ),
|
223 |
+
'menu_order' => __( 'Specified Order Setting', 'woothemes-features' ),
|
224 |
'rand' => __( 'Random Order', 'woothemes-features' )
|
225 |
);
|
226 |
} // End get_orderby_options()
|
232 |
*/
|
233 |
protected function get_order_options () {
|
234 |
return array(
|
235 |
+
'ASC' => __( 'Ascending', 'woothemes-features' ),
|
236 |
'DESC' => __( 'Descending', 'woothemes-features' )
|
237 |
);
|
238 |
} // End get_order_options()
|
239 |
} // End Class
|
240 |
|
241 |
/* Register the widget. */
|
242 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WooThemes_Widget_Features");' ), 1 );
|
243 |
?>
|
lang/woothemes-features-en_GB.po
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: Features v1.
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: \n"
|
6 |
-
"PO-Revision-Date: 2013-
|
7 |
"Last-Translator: Matt <matt@woothemes.com>\n"
|
8 |
"Language-Team: \n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -19,158 +19,161 @@ msgstr ""
|
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
"X-Textdomain-Support: yes"
|
21 |
|
22 |
-
#: classes/class-woothemes-features.php:
|
23 |
#@ woothemes-features
|
24 |
msgctxt "post type general name"
|
25 |
msgid "Features"
|
26 |
msgstr ""
|
27 |
|
28 |
-
#: classes/class-woothemes-features.php:
|
29 |
#@ woothemes-features
|
30 |
msgctxt "post type singular name"
|
31 |
msgid "Feature"
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: classes/class-woothemes-features.php:
|
35 |
#@ woothemes-features
|
36 |
msgctxt "feature"
|
37 |
msgid "Add New"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: classes/class-woothemes-features.php:
|
|
|
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 |
#: classes/class-woothemes-features.php:83
|
|
|
50 |
#@ woothemes-features
|
51 |
msgid "Feature"
|
52 |
msgstr ""
|
53 |
|
54 |
-
#: classes/class-woothemes-features.php:
|
|
|
55 |
#, php-format
|
56 |
#@ woothemes-features
|
57 |
msgid "Edit %s"
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: classes/class-woothemes-features.php:
|
61 |
#, php-format
|
62 |
#@ woothemes-features
|
63 |
msgid "New %s"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: classes/class-woothemes-features.php:
|
|
|
67 |
#, php-format
|
68 |
#@ woothemes-features
|
69 |
msgid "All %s"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: classes/class-woothemes-features.php:82
|
73 |
#: classes/class-woothemes-features.php:84
|
74 |
-
#: classes/class-woothemes-features.php:85
|
75 |
#: classes/class-woothemes-features.php:86
|
|
|
76 |
#: classes/class-woothemes-features.php:88
|
|
|
77 |
#: classes/class-woothemes-widget-features.php:44
|
78 |
#@ woothemes-features
|
79 |
msgid "Features"
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: classes/class-woothemes-features.php:
|
83 |
#, php-format
|
84 |
#@ woothemes-features
|
85 |
msgid "View %s"
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: classes/class-woothemes-features.php:
|
89 |
#, php-format
|
90 |
#@ woothemes-features
|
91 |
msgid "Search %a"
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: classes/class-woothemes-features.php:
|
95 |
#, php-format
|
96 |
#@ woothemes-features
|
97 |
msgid "No %s Found"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: classes/class-woothemes-features.php:
|
101 |
#, php-format
|
102 |
#@ woothemes-features
|
103 |
msgid "No %s Found In Trash"
|
104 |
msgstr ""
|
105 |
|
106 |
-
#: classes/class-woothemes-features.php:
|
107 |
#@ woothemes-features
|
108 |
msgid "Image"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: classes/class-woothemes-features.php:
|
112 |
#, php-format
|
113 |
#@ woothemes-features
|
114 |
msgid "Feature updated. %sView feature%s"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: classes/class-woothemes-features.php:
|
118 |
#@ woothemes-features
|
119 |
msgid "Custom field updated."
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: classes/class-woothemes-features.php:
|
123 |
#@ woothemes-features
|
124 |
msgid "Custom field deleted."
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: classes/class-woothemes-features.php:
|
128 |
#@ woothemes-features
|
129 |
msgid "Feature updated."
|
130 |
msgstr ""
|
131 |
|
132 |
-
#. translators: %s: date and time of the revision
|
133 |
-
#: classes/class-woothemes-features.php:
|
134 |
#, php-format
|
135 |
#@ woothemes-features
|
136 |
msgid "Feature restored to revision from %s"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: classes/class-woothemes-features.php:
|
140 |
#, php-format
|
141 |
#@ woothemes-features
|
142 |
msgid "Feature published. %sView feature%s"
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: classes/class-woothemes-features.php:
|
146 |
#@ default
|
147 |
msgid "Feature saved."
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: classes/class-woothemes-features.php:
|
151 |
#, php-format
|
152 |
#@ woothemes-features
|
153 |
msgid "Feature submitted. %sPreview feature%s"
|
154 |
msgstr ""
|
155 |
|
156 |
-
#: classes/class-woothemes-features.php:
|
157 |
#, php-format
|
158 |
#@ woothemes-features
|
159 |
msgid "Feature scheduled for: %1$s. %2$sPreview feature%3$s"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: classes/class-woothemes-features.php:
|
163 |
#@ default
|
164 |
msgid "M j, Y @ G:i"
|
165 |
msgstr ""
|
166 |
|
167 |
-
#: classes/class-woothemes-features.php:
|
168 |
#, php-format
|
169 |
#@ woothemes-features
|
170 |
msgid "Feature draft updated. %sPreview feature%s"
|
171 |
msgstr ""
|
172 |
|
173 |
-
#: classes/class-woothemes-features.php:
|
174 |
#@ woothemes-features
|
175 |
msgid "Enter the feature title here"
|
176 |
msgstr ""
|
@@ -180,98 +183,168 @@ msgstr ""
|
|
180 |
msgid "Recent features listed on your site."
|
181 |
msgstr ""
|
182 |
|
183 |
-
#: classes/class-woothemes-widget-features.php:
|
184 |
#@ woothemes-features
|
185 |
msgid "Title (optional):"
|
186 |
msgstr ""
|
187 |
|
188 |
-
#: classes/class-woothemes-widget-features.php:
|
189 |
#@ woothemes-features
|
190 |
msgid "Limit:"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: classes/class-woothemes-widget-features.php:
|
194 |
#@ woothemes-features
|
195 |
msgid "Image Size (in pixels):"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: classes/class-woothemes-widget-features.php:
|
199 |
#@ woothemes-features
|
200 |
msgid "Order By:"
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: classes/class-woothemes-widget-features.php:
|
204 |
#@ woothemes-features
|
205 |
msgid "Order Direction:"
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: classes/class-woothemes-widget-features.php:
|
209 |
#@ woothemes-features
|
210 |
msgid "Specific ID (optional):"
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: classes/class-woothemes-widget-features.php:
|
214 |
#@ woothemes-features
|
215 |
msgid "No Order"
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: classes/class-woothemes-widget-features.php:
|
219 |
#@ woothemes-features
|
220 |
msgid "Entry ID"
|
221 |
msgstr ""
|
222 |
|
223 |
-
#: classes/class-woothemes-widget-features.php:
|
224 |
#@ woothemes-features
|
225 |
msgid "Title"
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: classes/class-woothemes-widget-features.php:
|
229 |
#@ woothemes-features
|
230 |
msgid "Date Added"
|
231 |
msgstr ""
|
232 |
|
233 |
-
#: classes/class-woothemes-widget-features.php:
|
234 |
#@ woothemes-features
|
235 |
msgid "Specified Order Setting"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: classes/class-woothemes-widget-features.php:
|
239 |
#@ woothemes-features
|
240 |
msgid "Ascending"
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: classes/class-woothemes-widget-features.php:
|
244 |
#@ woothemes-features
|
245 |
msgid "Descending"
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: classes/class-woothemes-features.php:
|
249 |
#@ woothemes-features
|
250 |
msgid "Feature Details"
|
251 |
msgstr ""
|
252 |
|
253 |
-
#: classes/class-woothemes-features.php:
|
254 |
#@ woothemes-features
|
255 |
msgid "URL"
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: classes/class-woothemes-features.php:
|
259 |
#@ woothemes-features
|
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:
|
264 |
#@ woothemes-features
|
265 |
msgid "Items Per Row:"
|
266 |
msgstr ""
|
267 |
|
268 |
-
#: classes/class-woothemes-widget-features.php:
|
269 |
#@ woothemes-features
|
270 |
msgid "Display a specific feature, rather than a list."
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: classes/class-woothemes-widget-features.php:
|
274 |
#@ woothemes-features
|
275 |
msgid "Random Order"
|
276 |
msgstr ""
|
277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: Features v1.3.0\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: \n"
|
6 |
+
"PO-Revision-Date: 2013-04-30 12:39:20+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:78
|
23 |
#@ woothemes-features
|
24 |
msgctxt "post type general name"
|
25 |
msgid "Features"
|
26 |
msgstr ""
|
27 |
|
28 |
+
#: classes/class-woothemes-features.php:79
|
29 |
#@ woothemes-features
|
30 |
msgctxt "post type singular name"
|
31 |
msgid "Feature"
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: classes/class-woothemes-features.php:80
|
35 |
#@ woothemes-features
|
36 |
msgctxt "feature"
|
37 |
msgid "Add New"
|
38 |
msgstr ""
|
39 |
|
40 |
+
#: classes/class-woothemes-features-taxonomy.php:103
|
41 |
+
#: classes/class-woothemes-features.php:81
|
42 |
#, php-format
|
43 |
#@ woothemes-features
|
44 |
msgid "Add New %s"
|
45 |
msgstr ""
|
46 |
|
|
|
|
|
47 |
#: classes/class-woothemes-features.php:81
|
48 |
+
#: classes/class-woothemes-features.php:82
|
49 |
#: classes/class-woothemes-features.php:83
|
50 |
+
#: classes/class-woothemes-features.php:85
|
51 |
#@ woothemes-features
|
52 |
msgid "Feature"
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: classes/class-woothemes-features-taxonomy.php:101
|
56 |
+
#: classes/class-woothemes-features.php:82
|
57 |
#, php-format
|
58 |
#@ woothemes-features
|
59 |
msgid "Edit %s"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: classes/class-woothemes-features.php:83
|
63 |
#, php-format
|
64 |
#@ woothemes-features
|
65 |
msgid "New %s"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: classes/class-woothemes-features-taxonomy.php:98
|
69 |
+
#: classes/class-woothemes-features.php:84
|
70 |
#, php-format
|
71 |
#@ woothemes-features
|
72 |
msgid "All %s"
|
73 |
msgstr ""
|
74 |
|
|
|
75 |
#: classes/class-woothemes-features.php:84
|
|
|
76 |
#: classes/class-woothemes-features.php:86
|
77 |
+
#: classes/class-woothemes-features.php:87
|
78 |
#: classes/class-woothemes-features.php:88
|
79 |
+
#: classes/class-woothemes-features.php:90
|
80 |
#: classes/class-woothemes-widget-features.php:44
|
81 |
#@ woothemes-features
|
82 |
msgid "Features"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: classes/class-woothemes-features.php:85
|
86 |
#, php-format
|
87 |
#@ woothemes-features
|
88 |
msgid "View %s"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: classes/class-woothemes-features.php:86
|
92 |
#, php-format
|
93 |
#@ woothemes-features
|
94 |
msgid "Search %a"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: classes/class-woothemes-features.php:87
|
98 |
#, php-format
|
99 |
#@ woothemes-features
|
100 |
msgid "No %s Found"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: classes/class-woothemes-features.php:88
|
104 |
#, php-format
|
105 |
#@ woothemes-features
|
106 |
msgid "No %s Found In Trash"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: classes/class-woothemes-features.php:161
|
110 |
#@ woothemes-features
|
111 |
msgid "Image"
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: classes/class-woothemes-features.php:195
|
115 |
#, php-format
|
116 |
#@ woothemes-features
|
117 |
msgid "Feature updated. %sView feature%s"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: classes/class-woothemes-features.php:196
|
121 |
#@ woothemes-features
|
122 |
msgid "Custom field updated."
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: classes/class-woothemes-features.php:197
|
126 |
#@ woothemes-features
|
127 |
msgid "Custom field deleted."
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: classes/class-woothemes-features.php:198
|
131 |
#@ woothemes-features
|
132 |
msgid "Feature updated."
|
133 |
msgstr ""
|
134 |
|
135 |
+
#. translators: %s: date and time of the revision
|
136 |
+
#: classes/class-woothemes-features.php:200
|
137 |
#, php-format
|
138 |
#@ woothemes-features
|
139 |
msgid "Feature restored to revision from %s"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: classes/class-woothemes-features.php:201
|
143 |
#, php-format
|
144 |
#@ woothemes-features
|
145 |
msgid "Feature published. %sView feature%s"
|
146 |
msgstr ""
|
147 |
|
148 |
+
#: classes/class-woothemes-features.php:202
|
149 |
#@ default
|
150 |
msgid "Feature saved."
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: classes/class-woothemes-features.php:203
|
154 |
#, php-format
|
155 |
#@ woothemes-features
|
156 |
msgid "Feature submitted. %sPreview feature%s"
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: classes/class-woothemes-features.php:204
|
160 |
#, php-format
|
161 |
#@ woothemes-features
|
162 |
msgid "Feature scheduled for: %1$s. %2$sPreview feature%3$s"
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: classes/class-woothemes-features.php:206
|
166 |
#@ default
|
167 |
msgid "M j, Y @ G:i"
|
168 |
msgstr ""
|
169 |
|
170 |
+
#: classes/class-woothemes-features.php:207
|
171 |
#, php-format
|
172 |
#@ woothemes-features
|
173 |
msgid "Feature draft updated. %sPreview feature%s"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: classes/class-woothemes-features.php:320
|
177 |
#@ woothemes-features
|
178 |
msgid "Enter the feature title here"
|
179 |
msgstr ""
|
183 |
msgid "Recent features listed on your site."
|
184 |
msgstr ""
|
185 |
|
186 |
+
#: classes/class-woothemes-widget-features.php:159
|
187 |
#@ woothemes-features
|
188 |
msgid "Title (optional):"
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: classes/class-woothemes-widget-features.php:164
|
192 |
#@ woothemes-features
|
193 |
msgid "Limit:"
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: classes/class-woothemes-widget-features.php:169
|
197 |
#@ woothemes-features
|
198 |
msgid "Image Size (in pixels):"
|
199 |
msgstr ""
|
200 |
|
201 |
+
#: classes/class-woothemes-widget-features.php:179
|
202 |
#@ woothemes-features
|
203 |
msgid "Order By:"
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: classes/class-woothemes-widget-features.php:188
|
207 |
#@ woothemes-features
|
208 |
msgid "Order Direction:"
|
209 |
msgstr ""
|
210 |
|
211 |
+
#: classes/class-woothemes-widget-features.php:205
|
212 |
#@ woothemes-features
|
213 |
msgid "Specific ID (optional):"
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: classes/class-woothemes-widget-features.php:219
|
217 |
#@ woothemes-features
|
218 |
msgid "No Order"
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: classes/class-woothemes-widget-features.php:220
|
222 |
#@ woothemes-features
|
223 |
msgid "Entry ID"
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: classes/class-woothemes-widget-features.php:221
|
227 |
#@ woothemes-features
|
228 |
msgid "Title"
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: classes/class-woothemes-widget-features.php:222
|
232 |
#@ woothemes-features
|
233 |
msgid "Date Added"
|
234 |
msgstr ""
|
235 |
|
236 |
+
#: classes/class-woothemes-widget-features.php:223
|
237 |
#@ woothemes-features
|
238 |
msgid "Specified Order Setting"
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: classes/class-woothemes-widget-features.php:235
|
242 |
#@ woothemes-features
|
243 |
msgid "Ascending"
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: classes/class-woothemes-widget-features.php:236
|
247 |
#@ woothemes-features
|
248 |
msgid "Descending"
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: classes/class-woothemes-features.php:221
|
252 |
#@ woothemes-features
|
253 |
msgid "Feature Details"
|
254 |
msgstr ""
|
255 |
|
256 |
+
#: classes/class-woothemes-features.php:346
|
257 |
#@ woothemes-features
|
258 |
msgid "URL"
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: classes/class-woothemes-features.php:347
|
262 |
#@ woothemes-features
|
263 |
msgid "Enter a URL that applies to this feature (for example: http://woothemes.com/)."
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: classes/class-woothemes-widget-features.php:174
|
267 |
#@ woothemes-features
|
268 |
msgid "Items Per Row:"
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: classes/class-woothemes-widget-features.php:208
|
272 |
#@ woothemes-features
|
273 |
msgid "Display a specific feature, rather than a list."
|
274 |
msgstr ""
|
275 |
|
276 |
+
#: classes/class-woothemes-widget-features.php:224
|
277 |
#@ woothemes-features
|
278 |
msgid "Random Order"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: classes/class-woothemes-features-taxonomy.php:71
|
282 |
+
#@ woothemes-features
|
283 |
+
msgid "Category"
|
284 |
+
msgstr ""
|
285 |
+
|
286 |
+
#: classes/class-woothemes-features-taxonomy.php:72
|
287 |
+
#@ woothemes-features
|
288 |
+
msgid "Categories"
|
289 |
+
msgstr ""
|
290 |
+
|
291 |
+
#: classes/class-woothemes-features-taxonomy.php:95
|
292 |
+
#, php-format
|
293 |
+
#@ woothemes-features
|
294 |
+
msgctxt "taxonomy general name"
|
295 |
+
msgid "%s"
|
296 |
+
msgstr ""
|
297 |
+
|
298 |
+
#: classes/class-woothemes-features-taxonomy.php:96
|
299 |
+
#, php-format
|
300 |
+
#@ woothemes-features
|
301 |
+
msgctxt "taxonomy singular name"
|
302 |
+
msgid "%s"
|
303 |
+
msgstr ""
|
304 |
+
|
305 |
+
#: classes/class-woothemes-features-taxonomy.php:97
|
306 |
+
#, php-format
|
307 |
+
#@ woothemes-features
|
308 |
+
msgid "Search %s"
|
309 |
+
msgstr ""
|
310 |
+
|
311 |
+
#: classes/class-woothemes-features-taxonomy.php:99
|
312 |
+
#, php-format
|
313 |
+
#@ woothemes-features
|
314 |
+
msgid "Parent %s"
|
315 |
+
msgstr ""
|
316 |
+
|
317 |
+
#: classes/class-woothemes-features-taxonomy.php:100
|
318 |
+
#, php-format
|
319 |
+
#@ woothemes-features
|
320 |
+
msgid "Parent %s:"
|
321 |
+
msgstr ""
|
322 |
+
|
323 |
+
#: classes/class-woothemes-features-taxonomy.php:102
|
324 |
+
#, php-format
|
325 |
+
#@ woothemes-features
|
326 |
+
msgid "Update %s"
|
327 |
+
msgstr ""
|
328 |
+
|
329 |
+
#: classes/class-woothemes-features-taxonomy.php:104
|
330 |
+
#, php-format
|
331 |
+
#@ woothemes-features
|
332 |
+
msgid "New %s Name"
|
333 |
+
msgstr ""
|
334 |
+
|
335 |
+
#: classes/class-woothemes-features-taxonomy.php:105
|
336 |
+
#, php-format
|
337 |
+
#@ woothemes-features
|
338 |
+
msgid "%s"
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#: classes/class-woothemes-widget-features.php:197
|
342 |
+
#@ woothemes-features
|
343 |
+
msgid "Category:"
|
344 |
+
msgstr ""
|
345 |
+
|
346 |
+
#: classes/class-woothemes-widget-features.php:199
|
347 |
+
#@ woothemes-features
|
348 |
+
msgid "All"
|
349 |
+
msgstr ""
|
350 |
+
|
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
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -40,6 +40,7 @@ To add arguments to this, please use any of the following arguments, using the s
|
|
40 |
* 'after' => '</div>' (the ending HTML, wrapping the features)
|
41 |
* 'before_title' => '<h2>' (the starting HTML, wrapping the title)
|
42 |
* 'after_title' => '</h2>' (the ending HTML, wrapping the title)
|
|
|
43 |
|
44 |
The various options for the "orderby" parameter are:
|
45 |
|
@@ -101,6 +102,9 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi
|
|
101 |
|
102 |
== Upgrade Notice ==
|
103 |
|
|
|
|
|
|
|
104 |
= 1.2.2 =
|
105 |
* Minor bugfixes to the "order" directions options and additions to the "woothemes_features_html" filter.
|
106 |
|
@@ -123,6 +127,13 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi
|
|
123 |
|
124 |
== Changelog ==
|
125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
= 1.2.2 =
|
127 |
* 2013-01-03
|
128 |
* Fix the "order" direction options to be in capitals.
|
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.1
|
7 |
+
Stable tag: 1.3.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
40 |
* 'after' => '</div>' (the ending HTML, wrapping the features)
|
41 |
* 'before_title' => '<h2>' (the starting HTML, wrapping the title)
|
42 |
* 'after_title' => '</h2>' (the ending HTML, wrapping the title)
|
43 |
+
* 'category' => 0 (the ID/slug of the category to filter by)
|
44 |
|
45 |
The various options for the "orderby" parameter are:
|
46 |
|
102 |
|
103 |
== Upgrade Notice ==
|
104 |
|
105 |
+
= 1.3.0 =
|
106 |
+
* Adds "woothemes_features_content" filter and shortcode support. Adds "feature-category" taxonomy.
|
107 |
+
|
108 |
= 1.2.2 =
|
109 |
* Minor bugfixes to the "order" directions options and additions to the "woothemes_features_html" filter.
|
110 |
|
127 |
|
128 |
== Changelog ==
|
129 |
|
130 |
+
= 1.3.0 =
|
131 |
+
* 2013-04-30.
|
132 |
+
* Adds "woothemes_features_content" filter for modifying the content of features when outputting the features list.
|
133 |
+
* Adds default filters to the "woothemes_features_content" hook, enabling shortcodes in the content or excerpt fields.
|
134 |
+
* Adds "feature-category" taxonomy and necessary logic for displaying features from a specified category.
|
135 |
+
* Adds "columns-X" class to the ".features" DIV tag, for easier styling, using the "per_row" attribute.
|
136 |
+
|
137 |
= 1.2.2 =
|
138 |
* 2013-01-03
|
139 |
* Fix the "order" direction options to be in capitals.
|
woothemes-features-template.php
CHANGED
@@ -32,42 +32,43 @@ function woothemes_features ( $args = '' ) {
|
|
32 |
global $post;
|
33 |
|
34 |
$defaults = array(
|
35 |
-
'limit' => 5,
|
36 |
-
'orderby' => 'menu_order',
|
37 |
-
'order' => 'DESC',
|
38 |
-
'id' => 0,
|
39 |
-
'echo' => true,
|
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 );
|
51 |
-
|
52 |
// Allow child themes/plugins to filter here.
|
53 |
$args = apply_filters( 'woothemes_features_args', $args );
|
54 |
$html = '';
|
55 |
|
56 |
do_action( 'woothemes_features_before', $args );
|
57 |
-
|
58 |
// The Query.
|
59 |
$query = woothemes_get_features( $args );
|
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>';
|
73 |
$tpl = apply_filters( 'woothemes_features_item_template', $tpl, $args );
|
@@ -78,7 +79,7 @@ function woothemes_features ( $args = '' ) {
|
|
78 |
$i++;
|
79 |
|
80 |
setup_postdata( $post );
|
81 |
-
|
82 |
$class = 'feature';
|
83 |
|
84 |
if( ( 0 == $i % $args['per_row'] ) ) {
|
@@ -105,10 +106,12 @@ function woothemes_features ( $args = '' ) {
|
|
105 |
$template = str_replace( '%%TITLE%%', $title, $template );
|
106 |
|
107 |
if ( '' != $post->post_excerpt ) {
|
108 |
-
$
|
109 |
} else {
|
110 |
-
$
|
111 |
}
|
|
|
|
|
112 |
|
113 |
$template = apply_filters( 'woothemes_features_template', $template, $post );
|
114 |
|
@@ -124,32 +127,40 @@ function woothemes_features ( $args = '' ) {
|
|
124 |
|
125 |
wp_reset_postdata();
|
126 |
}
|
127 |
-
|
128 |
// Allow child themes/plugins to filter here.
|
129 |
$html = apply_filters( 'woothemes_features_html', $html, $query, $args );
|
130 |
-
|
131 |
if ( $args['echo'] != true ) { return $html; }
|
132 |
-
|
133 |
// Should only run is "echo" is set to true.
|
134 |
echo $html;
|
135 |
-
|
136 |
do_action( 'woothemes_features_after', $args ); // Only if "echo" is set to true.
|
137 |
} // End woothemes_features()
|
138 |
}
|
139 |
|
140 |
if ( ! function_exists( 'woothemes_features_shortcode' ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
function woothemes_features_shortcode ( $atts, $content = null ) {
|
142 |
$args = (array)$atts;
|
143 |
|
144 |
$defaults = array(
|
145 |
-
'limit' => 5,
|
146 |
-
'orderby' => 'menu_order',
|
147 |
-
'order' => 'DESC',
|
148 |
-
'id' => 0,
|
149 |
-
'echo' => true,
|
150 |
-
'size' => 50,
|
151 |
-
'per_row' => 3,
|
152 |
-
'link_title' => true
|
|
|
153 |
);
|
154 |
|
155 |
$args = shortcode_atts( $defaults, $atts );
|
@@ -162,6 +173,7 @@ function woothemes_features_shortcode ( $atts, $content = null ) {
|
|
162 |
if ( isset( $args['id'] ) ) $args['id'] = intval( $args['id'] );
|
163 |
if ( isset( $args['size'] ) && ( 0 < intval( $args['size'] ) ) ) $args['size'] = intval( $args['size'] );
|
164 |
if ( isset( $args['per_row'] ) && ( 0 < intval( $args['per_row'] ) ) ) $args['per_row'] = intval( $args['per_row'] );
|
|
|
165 |
|
166 |
// Fix booleans.
|
167 |
foreach ( array( 'link_title' ) as $k => $v ) {
|
@@ -177,4 +189,17 @@ function woothemes_features_shortcode ( $atts, $content = null ) {
|
|
177 |
}
|
178 |
|
179 |
add_shortcode( 'woothemes_features', 'woothemes_features_shortcode' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
?>
|
32 |
global $post;
|
33 |
|
34 |
$defaults = array(
|
35 |
+
'limit' => 5,
|
36 |
+
'orderby' => 'menu_order',
|
37 |
+
'order' => 'DESC',
|
38 |
+
'id' => 0,
|
39 |
+
'echo' => true,
|
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 |
+
'category' => 0
|
49 |
);
|
50 |
+
|
51 |
$args = wp_parse_args( $args, $defaults );
|
52 |
+
|
53 |
// Allow child themes/plugins to filter here.
|
54 |
$args = apply_filters( 'woothemes_features_args', $args );
|
55 |
$html = '';
|
56 |
|
57 |
do_action( 'woothemes_features_before', $args );
|
58 |
+
|
59 |
// The Query.
|
60 |
$query = woothemes_get_features( $args );
|
61 |
|
62 |
// The Display.
|
63 |
if ( ! is_wp_error( $query ) && is_array( $query ) && count( $query ) > 0 ) {
|
64 |
$html .= $args['before'] . "\n";
|
65 |
+
|
66 |
if ( '' != $args['title'] ) {
|
67 |
$html .= $args['before_title'] . esc_html( $args['title'] ) . $args['after_title'] . "\n";
|
68 |
}
|
69 |
|
70 |
+
$html .= '<div class="features columns-' . esc_attr( intval( $args['per_row'] ) ) . '">' . "\n";
|
71 |
+
|
72 |
// Begin templating logic.
|
73 |
$tpl = '<div class="%%CLASS%%">%%IMAGE%%<h3 class="feature-title">%%TITLE%%</h3><div class="feature-content">%%CONTENT%%</div></div>';
|
74 |
$tpl = apply_filters( 'woothemes_features_item_template', $tpl, $args );
|
79 |
$i++;
|
80 |
|
81 |
setup_postdata( $post );
|
82 |
+
|
83 |
$class = 'feature';
|
84 |
|
85 |
if( ( 0 == $i % $args['per_row'] ) ) {
|
106 |
$template = str_replace( '%%TITLE%%', $title, $template );
|
107 |
|
108 |
if ( '' != $post->post_excerpt ) {
|
109 |
+
$content = get_the_excerpt();
|
110 |
} else {
|
111 |
+
$content = get_the_content();
|
112 |
}
|
113 |
+
$content = apply_filters( 'woothemes_features_content', $content, $post );
|
114 |
+
$template = str_replace( '%%CONTENT%%', $content, $template );
|
115 |
|
116 |
$template = apply_filters( 'woothemes_features_template', $template, $post );
|
117 |
|
127 |
|
128 |
wp_reset_postdata();
|
129 |
}
|
130 |
+
|
131 |
// Allow child themes/plugins to filter here.
|
132 |
$html = apply_filters( 'woothemes_features_html', $html, $query, $args );
|
133 |
+
|
134 |
if ( $args['echo'] != true ) { return $html; }
|
135 |
+
|
136 |
// Should only run is "echo" is set to true.
|
137 |
echo $html;
|
138 |
+
|
139 |
do_action( 'woothemes_features_after', $args ); // Only if "echo" is set to true.
|
140 |
} // End woothemes_features()
|
141 |
}
|
142 |
|
143 |
if ( ! function_exists( 'woothemes_features_shortcode' ) ) {
|
144 |
+
/**
|
145 |
+
* The shortcode function.
|
146 |
+
* @since 1.0.0
|
147 |
+
* @param array $atts Shortcode attributes.
|
148 |
+
* @param string $content If the shortcode is a wrapper, this is the content being wrapped.
|
149 |
+
* @return string Output using the template tag.
|
150 |
+
*/
|
151 |
function woothemes_features_shortcode ( $atts, $content = null ) {
|
152 |
$args = (array)$atts;
|
153 |
|
154 |
$defaults = array(
|
155 |
+
'limit' => 5,
|
156 |
+
'orderby' => 'menu_order',
|
157 |
+
'order' => 'DESC',
|
158 |
+
'id' => 0,
|
159 |
+
'echo' => true,
|
160 |
+
'size' => 50,
|
161 |
+
'per_row' => 3,
|
162 |
+
'link_title' => true,
|
163 |
+
'category' => 0
|
164 |
);
|
165 |
|
166 |
$args = shortcode_atts( $defaults, $atts );
|
173 |
if ( isset( $args['id'] ) ) $args['id'] = intval( $args['id'] );
|
174 |
if ( isset( $args['size'] ) && ( 0 < intval( $args['size'] ) ) ) $args['size'] = intval( $args['size'] );
|
175 |
if ( isset( $args['per_row'] ) && ( 0 < intval( $args['per_row'] ) ) ) $args['per_row'] = intval( $args['per_row'] );
|
176 |
+
if ( isset( $args['category'] ) && is_numeric( $args['category'] ) ) $args['category'] = intval( $args['category'] );
|
177 |
|
178 |
// Fix booleans.
|
179 |
foreach ( array( 'link_title' ) as $k => $v ) {
|
189 |
}
|
190 |
|
191 |
add_shortcode( 'woothemes_features', 'woothemes_features_shortcode' );
|
192 |
+
|
193 |
+
if ( ! function_exists( 'woothemes_features_content_default_filters' ) ) {
|
194 |
+
/**
|
195 |
+
* Adds default filters to the "woothemes_features_content" filter point.
|
196 |
+
* @since 1.3.0
|
197 |
+
* @return void
|
198 |
+
*/
|
199 |
+
function woothemes_features_content_default_filters () {
|
200 |
+
add_filter( 'woothemes_features_content', 'do_shortcode' );
|
201 |
+
} // End woothemes_features_content_default_filters()
|
202 |
+
|
203 |
+
add_action( 'woothemes_features_before', 'woothemes_features_content_default_filters' );
|
204 |
+
}
|
205 |
?>
|
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.
|
8 |
* Author URI: http://woothemes.com/
|
9 |
*
|
10 |
* @package WordPress
|
@@ -14,8 +14,10 @@
|
|
14 |
*/
|
15 |
|
16 |
require_once( 'classes/class-woothemes-features.php' );
|
|
|
17 |
require_once( 'woothemes-features-template.php' );
|
18 |
require_once( 'classes/class-woothemes-widget-features.php' );
|
19 |
global $woothemes_features;
|
20 |
$woothemes_features = new Woothemes_Features( __FILE__ );
|
|
|
21 |
?>
|
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.3.0
|
8 |
* Author URI: http://woothemes.com/
|
9 |
*
|
10 |
* @package WordPress
|
14 |
*/
|
15 |
|
16 |
require_once( 'classes/class-woothemes-features.php' );
|
17 |
+
require_once( 'classes/class-woothemes-features-taxonomy.php' );
|
18 |
require_once( 'woothemes-features-template.php' );
|
19 |
require_once( 'classes/class-woothemes-widget-features.php' );
|
20 |
global $woothemes_features;
|
21 |
$woothemes_features = new Woothemes_Features( __FILE__ );
|
22 |
+
$woothemes_features->version = '1.3.0';
|
23 |
?>
|