Flexible Posts Widget - Version 3.1.1

Version Description

  • Fixed incorrect use of rtrim in getTemplateHierarchy when getting custom template files. (Props: @mortenf)
Download this release

Release Info

Developer dpe415
Plugin Icon wp plugin Flexible Posts Widget
Version 3.1.1
Comparing to
See all releases

Code changes from version 3.0.2 to 3.1.1

flexible-posts-widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Flexible Posts Widget
4
  Plugin URI: http://wordpress.org/extend/plugins/flexible-posts-widget/
5
  Author: dpe415
6
  Author URI: http://dpedesign.com
7
- Version: 3.0.2
8
  Description: An advanced posts display widget with many options: get posts by post type, taxonomy & term; sorting & ordering; feature images; custom templates and more.
9
  License: GPL2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -24,17 +24,29 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
24
  You should have received a copy of the GNU General Public License
25
  along with this program; if not, write to the Free Software
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
- */
28
 
29
  // Block direct requests
30
  if( !defined('ABSPATH') )
31
  die('-1');
32
-
 
33
  if( !defined('DPE_FP_Version') )
34
- define( 'DPE_FP_Version', '3.0.2' );
 
 
 
 
 
 
 
 
 
35
 
36
 
37
- // Load the widget on widgets_init
 
 
38
  function dpe_load_flexible_posts_widget() {
39
  register_widget('DPE_Flexible_Posts_Widget');
40
  }
@@ -56,7 +68,7 @@ class DPE_Flexible_Posts_Widget extends WP_Widget {
56
  parent::__construct(
57
  'dpe_fp_widget', // Base ID
58
  'Flexible Posts Widget', // Name
59
- array( 'description' => __( 'Display posts as widget items', 'text_domain' ), ) // Args
60
  );
61
 
62
  $this->directory = plugins_url( '/', __FILE__ );
@@ -67,8 +79,13 @@ class DPE_Flexible_Posts_Widget extends WP_Widget {
67
  // Enqueue admin scripts
68
  if ( defined("WP_ADMIN") && WP_ADMIN ) {
69
  if ( 'widgets.php' == $pagenow ) {
70
- wp_enqueue_script( 'dpe-fp-widget' );
71
- wp_enqueue_style( 'dpe-fp-widget' );
 
 
 
 
 
72
  }
73
  }
74
 
@@ -141,18 +158,18 @@ class DPE_Flexible_Posts_Widget extends WP_Widget {
141
  $this->taxonomies = get_taxonomies( array('public' => true ), 'objects' );
142
  $this->thumbsizes = get_intermediate_image_sizes();
143
  $this->orderbys = array(
144
- 'date' => 'Publish Date',
145
- 'title' => 'Title',
146
- 'menu_order' => 'Menu Order',
147
- 'ID' => 'Post ID',
148
- 'author' => 'Author',
149
- 'name' => 'Post Slug',
150
- 'comment_count' => 'Comment Count',
151
- 'rand' => 'Random',
152
  );
153
  $this->orders = array(
154
- 'ASC' => 'Ascending',
155
- 'DESC' => 'Descending',
156
  );
157
 
158
  $pt_names = get_post_types( array('public' => true ), 'names' );
@@ -219,18 +236,18 @@ class DPE_Flexible_Posts_Widget extends WP_Widget {
219
  $this->taxonomies = get_taxonomies( array('public' => true ), 'objects' );
220
  $this->thumbsizes = get_intermediate_image_sizes();
221
  $this->orderbys = array(
222
- 'date' => 'Publish Date',
223
- 'title' => 'Title',
224
- 'menu_order' => 'Menu Order',
225
- 'ID' => 'Post ID',
226
- 'author' => 'Author',
227
- 'name' => 'Post Slug',
228
- 'comment_count' => 'Comment Count',
229
- 'rand' => 'Random',
230
  );
231
  $this->orders = array(
232
- 'ASC' => 'Ascending',
233
- 'DESC' => 'Descending',
234
  );
235
 
236
  $instance = wp_parse_args( (array) $instance, array(
@@ -259,7 +276,7 @@ class DPE_Flexible_Posts_Widget extends WP_Widget {
259
  * 2) parent template, 3) plugin resources. will look in the flexible-posts-widget/
260
  * directory in a theme and the views/ directory in the plugin
261
  *
262
- * Function generously borrowed from the amazing image-widget
263
  * by Matt Wiebe at Modern Tribe, Inc.
264
  * http://wordpress.org/extend/plugins/image-widget/
265
  *
@@ -269,7 +286,7 @@ class DPE_Flexible_Posts_Widget extends WP_Widget {
269
  public function getTemplateHierarchy( $template ) {
270
 
271
  // whether or not .php was added
272
- $template_slug = rtrim( $template, '.php' );
273
  $template = $template_slug . '.php';
274
 
275
  if ( $theme_file = locate_template( array( 'flexible-posts-widget/' . $template ) ) ) {
@@ -288,8 +305,8 @@ class DPE_Flexible_Posts_Widget extends WP_Widget {
288
  * Register styles & scripts
289
  */
290
  public function register_sns( $dir ) {
291
- wp_register_script( 'dpe-fp-widget', $dir . 'js/admin.js', array('jquery', 'jquery-ui-tabs' ), DPE_FP_Version, true );
292
- wp_register_style( 'dpe-fp-widget', $dir . 'css/admin.css', array(), DPE_FP_Version );
293
  }
294
 
295
  /**
@@ -321,7 +338,7 @@ class DPE_Flexible_Posts_Widget extends WP_Widget {
321
  $terms = get_terms( $taxonomy, $args );
322
 
323
  if( empty($terms) ) {
324
- $output = '<p>No terms found.</p>';
325
  } else {
326
  $output = '<ul class="categorychecklist termschecklist form-no-clear">';
327
  foreach ( $terms as $option ) {
@@ -356,5 +373,3 @@ class DPE_Flexible_Posts_Widget extends WP_Widget {
356
 
357
 
358
  } // class DPE_Flexible_Posts_Widget
359
-
360
- ?>
4
  Plugin URI: http://wordpress.org/extend/plugins/flexible-posts-widget/
5
  Author: dpe415
6
  Author URI: http://dpedesign.com
7
+ Version: 3.1.1
8
  Description: An advanced posts display widget with many options: get posts by post type, taxonomy & term; sorting & ordering; feature images; custom templates and more.
9
  License: GPL2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
24
  You should have received a copy of the GNU General Public License
25
  along with this program; if not, write to the Free Software
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
+ */
28
 
29
  // Block direct requests
30
  if( !defined('ABSPATH') )
31
  die('-1');
32
+
33
+ // Define our version number
34
  if( !defined('DPE_FP_Version') )
35
+ define( 'DPE_FP_Version', '3.1.1' );
36
+
37
+ /**
38
+ * Plugin Initialization
39
+ * Used for internationalization only at this point
40
+ */
41
+ function dpe_flexible_posts_widget_init() {
42
+ load_plugin_textdomain( 'flexible-posts-widget', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
43
+ }
44
+ add_action('plugins_loaded', 'dpe_flexible_posts_widget_init');
45
 
46
 
47
+ /**
48
+ * Initialize the widget on widgets_init
49
+ */
50
  function dpe_load_flexible_posts_widget() {
51
  register_widget('DPE_Flexible_Posts_Widget');
52
  }
68
  parent::__construct(
69
  'dpe_fp_widget', // Base ID
70
  'Flexible Posts Widget', // Name
71
+ array( 'description' => __( 'Display posts as widget items', 'flexible-posts-widget' ) ) // Args
72
  );
73
 
74
  $this->directory = plugins_url( '/', __FILE__ );
79
  // Enqueue admin scripts
80
  if ( defined("WP_ADMIN") && WP_ADMIN ) {
81
  if ( 'widgets.php' == $pagenow ) {
82
+ wp_enqueue_script( 'flexible-posts-widget' );
83
+ wp_enqueue_style( 'flexible-posts-widget' );
84
+ wp_localize_script( 'flexible-posts-widget', 'objectL10n', array(
85
+ 'gettingTerms' => __( 'Getting terms...', 'flexible-posts-widget' ),
86
+ 'selectTerms' => __( 'Select terms:', 'flexible-posts-widget' ),
87
+ 'noTermsFound' => __( 'No terms found.', 'flexible-posts-widget' ),
88
+ ) );
89
  }
90
  }
91
 
158
  $this->taxonomies = get_taxonomies( array('public' => true ), 'objects' );
159
  $this->thumbsizes = get_intermediate_image_sizes();
160
  $this->orderbys = array(
161
+ 'date' => __('Publish Date', 'flexible-posts-widget'),
162
+ 'title' => __('Title', 'flexible-posts-widget'),
163
+ 'menu_order' => __('Menu Order', 'flexible-posts-widget'),
164
+ 'ID' => __('Post ID', 'flexible-posts-widget'),
165
+ 'author' => __('Author', 'flexible-posts-widget'),
166
+ 'name' => __('Post Slug', 'flexible-posts-widget'),
167
+ 'comment_count' => __('Comment Count', 'flexible-posts-widget'),
168
+ 'rand' => __('Random', 'flexible-posts-widget'),
169
  );
170
  $this->orders = array(
171
+ 'ASC' => __('Ascending', 'flexible-posts-widget'),
172
+ 'DESC' => __('Descending', 'flexible-posts-widget'),
173
  );
174
 
175
  $pt_names = get_post_types( array('public' => true ), 'names' );
236
  $this->taxonomies = get_taxonomies( array('public' => true ), 'objects' );
237
  $this->thumbsizes = get_intermediate_image_sizes();
238
  $this->orderbys = array(
239
+ 'date' => __('Publish Date', 'flexible-posts-widget'),
240
+ 'title' => __('Title', 'flexible-posts-widget'),
241
+ 'menu_order' => __('Menu Order', 'flexible-posts-widget'),
242
+ 'ID' => __('Post ID', 'flexible-posts-widget'),
243
+ 'author' => __('Author', 'flexible-posts-widget'),
244
+ 'name' => __('Post Slug', 'flexible-posts-widget'),
245
+ 'comment_count' => __('Comment Count', 'flexible-posts-widget'),
246
+ 'rand' => __('Random', 'flexible-posts-widget'),
247
  );
248
  $this->orders = array(
249
+ 'ASC' => __('Ascending', 'flexible-posts-widget'),
250
+ 'DESC' => __('Descending', 'flexible-posts-widget'),
251
  );
252
 
253
  $instance = wp_parse_args( (array) $instance, array(
276
  * 2) parent template, 3) plugin resources. will look in the flexible-posts-widget/
277
  * directory in a theme and the views/ directory in the plugin
278
  *
279
+ * Based on a function in the amazing image-widget
280
  * by Matt Wiebe at Modern Tribe, Inc.
281
  * http://wordpress.org/extend/plugins/image-widget/
282
  *
286
  public function getTemplateHierarchy( $template ) {
287
 
288
  // whether or not .php was added
289
+ $template_slug = preg_replace( '/.php$/', '', $template );
290
  $template = $template_slug . '.php';
291
 
292
  if ( $theme_file = locate_template( array( 'flexible-posts-widget/' . $template ) ) ) {
305
  * Register styles & scripts
306
  */
307
  public function register_sns( $dir ) {
308
+ wp_register_script( 'flexible-posts-widget', $dir . 'js/admin.js', array('jquery', 'jquery-ui-tabs' ), DPE_FP_Version, true );
309
+ wp_register_style( 'flexible-posts-widget', $dir . 'css/admin.css', array(), DPE_FP_Version );
310
  }
311
 
312
  /**
338
  $terms = get_terms( $taxonomy, $args );
339
 
340
  if( empty($terms) ) {
341
+ $output = '<p>' . __( 'No terms found.', 'flexible-posts-widget' ) . '</p>';
342
  } else {
343
  $output = '<ul class="categorychecklist termschecklist form-no-clear">';
344
  foreach ( $terms as $option ) {
373
 
374
 
375
  } // class DPE_Flexible_Posts_Widget
 
 
js/admin.js CHANGED
@@ -62,7 +62,8 @@ jQuery('#widgets-right').on("change", 'select.dpe-fp-taxonomy', function(event)
62
  // If we're not ignoring Taxonomy & Term...
63
  if( jQuery(this).val() != 'none' ) {
64
 
65
- terms_label.html('Getting terms...').show();
 
66
 
67
  var selected_terms = [];
68
  terms_div.find("input:checked").each(function () {
@@ -77,10 +78,10 @@ jQuery('#widgets-right').on("change", 'select.dpe-fp-taxonomy', function(event)
77
 
78
  jQuery.post(ajaxurl, data, function(response) {
79
  terms_div.html(response);
80
- terms_label.html('Select terms:').show();
81
  terms_div.slideDown();
82
  }).error( function() {
83
- terms_label.html('No terms found.').show();
84
  });
85
 
86
  } else {
62
  // If we're not ignoring Taxonomy & Term...
63
  if( jQuery(this).val() != 'none' ) {
64
 
65
+
66
+ terms_label.html(objectL10n.gettingTerms).show();
67
 
68
  var selected_terms = [];
69
  terms_div.find("input:checked").each(function () {
78
 
79
  jQuery.post(ajaxurl, data, function(response) {
80
  terms_div.html(response);
81
+ terms_label.html(objectL10n.selectTerms).show();
82
  terms_div.slideDown();
83
  }).error( function() {
84
+ terms_label.html(objectL10n.noTermsFound).show();
85
  });
86
 
87
  } else {
languages/flexible-posts-widget-es_ES.mo ADDED
Binary file
languages/flexible-posts-widget-es_ES.po ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Flexible Posts Widget en español\n"
4
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/flexible-posts-widget\n"
5
+ "POT-Creation-Date: 2013-03-10 04:29:57+00:00\n"
6
+ "PO-Revision-Date: 2013-03-10 17:25+0100\n"
7
+ "Last-Translator: Eduardo Larequi <elarequi@gmail.com>\n"
8
+ "Language-Team: PNTE <blogs@educacion.navarra.es>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e;_x:1,2c;_n:1,2;_c;esc_html__;esc_html_e;esc_attr__;esc_attr_e\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "X-Poedit-Language: Spanish\n"
15
+ "X-Poedit-Country: Spain\n"
16
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: flexible-posts-widget.php:71
20
+ msgid "Display posts as widget items"
21
+ msgstr "Muestra las entradas como elementos de un widget"
22
+
23
+ #: flexible-posts-widget.php:85
24
+ msgid "Getting terms..."
25
+ msgstr "Obteniendo términos..."
26
+
27
+ #: flexible-posts-widget.php:86
28
+ #: views/admin.php:49
29
+ msgid "Select terms:"
30
+ msgstr "Seleccionar términos:"
31
+
32
+ #: flexible-posts-widget.php:87
33
+ #: flexible-posts-widget.php:341
34
+ #: views/admin.php:67
35
+ msgid "No terms found."
36
+ msgstr "No se ha encontrado ningún término."
37
+
38
+ #: flexible-posts-widget.php:161
39
+ #: flexible-posts-widget.php:239
40
+ msgid "Publish Date"
41
+ msgstr "Fecha de publicación"
42
+
43
+ #: flexible-posts-widget.php:162
44
+ #: flexible-posts-widget.php:240
45
+ msgid "Title"
46
+ msgstr "Título"
47
+
48
+ #: flexible-posts-widget.php:163
49
+ #: flexible-posts-widget.php:241
50
+ msgid "Menu Order"
51
+ msgstr "Orden de menú"
52
+
53
+ #: flexible-posts-widget.php:164
54
+ #: flexible-posts-widget.php:242
55
+ msgid "Post ID"
56
+ msgstr "ID de entrada"
57
+
58
+ #: flexible-posts-widget.php:165
59
+ #: flexible-posts-widget.php:243
60
+ msgid "Author"
61
+ msgstr "Autor"
62
+
63
+ #: flexible-posts-widget.php:166
64
+ #: flexible-posts-widget.php:244
65
+ msgid "Post Slug"
66
+ msgstr "Nombre de la entrada (slug)"
67
+
68
+ #: flexible-posts-widget.php:167
69
+ #: flexible-posts-widget.php:245
70
+ msgid "Comment Count"
71
+ msgstr "Total de comentarios"
72
+
73
+ #: flexible-posts-widget.php:168
74
+ #: flexible-posts-widget.php:246
75
+ msgid "Random"
76
+ msgstr "Al azar"
77
+
78
+ #: flexible-posts-widget.php:171
79
+ #: flexible-posts-widget.php:249
80
+ msgid "Ascending"
81
+ msgstr "Ascendente"
82
+
83
+ #: flexible-posts-widget.php:172
84
+ #: flexible-posts-widget.php:250
85
+ msgid "Descending"
86
+ msgstr "Descendente"
87
+
88
+ #: views/admin.php:15
89
+ msgid "Widget title:"
90
+ msgstr "Título del widget:"
91
+
92
+ #: views/admin.php:21
93
+ msgid "Get posts by"
94
+ msgstr "Obtener entradas por"
95
+
96
+ #: views/admin.php:29
97
+ msgid "Post Type"
98
+ msgstr "Tipo de contenido"
99
+
100
+ #: views/admin.php:30
101
+ msgid "Taxonomy &amp; Term"
102
+ msgstr "Taxonomías y términos"
103
+
104
+ #: views/admin.php:39
105
+ msgid "Select a taxonomy:"
106
+ msgstr "Seleccionar una taxonomía:"
107
+
108
+ #: views/admin.php:41
109
+ msgid "Ignore Taxonomy &amp; Term"
110
+ msgstr "Ignorar taxonomías y términos"
111
+
112
+ #: views/admin.php:83
113
+ msgid "Display options"
114
+ msgstr "Opciones de visualización"
115
+
116
+ #: views/admin.php:85
117
+ msgid "Number of posts to show:"
118
+ msgstr "Número de entradas que mostrar:"
119
+
120
+ #: views/admin.php:89
121
+ msgid "Number of posts to skip:"
122
+ msgstr "Número de entradas que saltar:"
123
+
124
+ #: views/admin.php:93
125
+ msgid "Order posts by:"
126
+ msgstr "Ordenar entradas por:"
127
+
128
+ #: views/admin.php:103
129
+ msgid "Order:"
130
+ msgstr "Orden:"
131
+
132
+ #: views/admin.php:117
133
+ msgid "Display thumbnails?"
134
+ msgstr "¿Mostrar miniaturas?"
135
+
136
+ #: views/admin.php:120
137
+ msgid "Select a thumbnail size to show:"
138
+ msgstr "Selecciona el tamaño de miniatura que se mostrará:"
139
+
140
+ #: views/admin.php:133
141
+ msgid "Template filename:"
142
+ msgstr "Nombre del fichero de plantilla:"
143
+
144
+ #: views/admin.php:136
145
+ msgid "See documentation"
146
+ msgstr "Ver la documentación"
147
+
148
+ #: views/admin.php:136
149
+ msgid "for details."
150
+ msgstr "para saber más sobre la plantilla personalizada para el widget."
151
+
152
+ #: views/widget.php:39
153
+ msgid "No post found"
154
+ msgstr "No se ha encontrado ninguna entrada"
155
+
156
+ #. Plugin Name of the plugin/theme
157
+ msgid "Flexible Posts Widget"
158
+ msgstr "Flexible Posts Widget"
159
+
160
+ #. Plugin URI of the plugin/theme
161
+ msgid "http://wordpress.org/extend/plugins/flexible-posts-widget/"
162
+ msgstr "http://wordpress.org/extend/plugins/flexible-posts-widget/"
163
+
164
+ #. Description of the plugin/theme
165
+ msgid "An advanced posts display widget with many options: get posts by post type, taxonomy & term; sorting & ordering; feature images; custom templates and more."
166
+ msgstr "Un widget avanzado para mostrar entradas, con muchas opciones: obtener entradas por tipo de contenido, taxonomía y términos; clasificación y ordenación; imágenes destacadas; plantillas personalizadas, etc."
167
+
168
+ #. Author of the plugin/theme
169
+ msgid "dpe415"
170
+ msgstr "dpe415"
171
+
172
+ #. Author URI of the plugin/theme
173
+ msgid "http://dpedesign.com"
174
+ msgstr "http://dpedesign.com"
175
+
languages/flexible-posts-widget.pot ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2013 Flexible Posts Widget
2
+ # This file is distributed under the same license as the Flexible Posts Widget package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Flexible Posts Widget 3.1\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/flexible-posts-widget\n"
7
+ "POT-Creation-Date: 2013-03-10 04:29:57+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: flexible-posts-widget.php:71
16
+ msgid "Display posts as widget items"
17
+ msgstr ""
18
+
19
+ #: flexible-posts-widget.php:85
20
+ msgid "Getting terms..."
21
+ msgstr ""
22
+
23
+ #: flexible-posts-widget.php:86 views/admin.php:49
24
+ msgid "Select terms:"
25
+ msgstr ""
26
+
27
+ #: flexible-posts-widget.php:87 flexible-posts-widget.php:341
28
+ #: views/admin.php:67
29
+ msgid "No terms found."
30
+ msgstr ""
31
+
32
+ #: flexible-posts-widget.php:161 flexible-posts-widget.php:239
33
+ msgid "Publish Date"
34
+ msgstr ""
35
+
36
+ #: flexible-posts-widget.php:162 flexible-posts-widget.php:240
37
+ msgid "Title"
38
+ msgstr ""
39
+
40
+ #: flexible-posts-widget.php:163 flexible-posts-widget.php:241
41
+ msgid "Menu Order"
42
+ msgstr ""
43
+
44
+ #: flexible-posts-widget.php:164 flexible-posts-widget.php:242
45
+ msgid "Post ID"
46
+ msgstr ""
47
+
48
+ #: flexible-posts-widget.php:165 flexible-posts-widget.php:243
49
+ msgid "Author"
50
+ msgstr ""
51
+
52
+ #: flexible-posts-widget.php:166 flexible-posts-widget.php:244
53
+ msgid "Post Slug"
54
+ msgstr ""
55
+
56
+ #: flexible-posts-widget.php:167 flexible-posts-widget.php:245
57
+ msgid "Comment Count"
58
+ msgstr ""
59
+
60
+ #: flexible-posts-widget.php:168 flexible-posts-widget.php:246
61
+ msgid "Random"
62
+ msgstr ""
63
+
64
+ #: flexible-posts-widget.php:171 flexible-posts-widget.php:249
65
+ msgid "Ascending"
66
+ msgstr ""
67
+
68
+ #: flexible-posts-widget.php:172 flexible-posts-widget.php:250
69
+ msgid "Descending"
70
+ msgstr ""
71
+
72
+ #: views/admin.php:15
73
+ msgid "Widget title:"
74
+ msgstr ""
75
+
76
+ #: views/admin.php:21
77
+ msgid "Get posts by"
78
+ msgstr ""
79
+
80
+ #: views/admin.php:29
81
+ msgid "Post Type"
82
+ msgstr ""
83
+
84
+ #: views/admin.php:30
85
+ msgid "Taxonomy &amp; Term"
86
+ msgstr ""
87
+
88
+ #: views/admin.php:39
89
+ msgid "Select a taxonomy:"
90
+ msgstr ""
91
+
92
+ #: views/admin.php:41
93
+ msgid "Ignore Taxonomy &amp; Term"
94
+ msgstr ""
95
+
96
+ #: views/admin.php:83
97
+ msgid "Display options"
98
+ msgstr ""
99
+
100
+ #: views/admin.php:85
101
+ msgid "Number of posts to show:"
102
+ msgstr ""
103
+
104
+ #: views/admin.php:89
105
+ msgid "Number of posts to skip:"
106
+ msgstr ""
107
+
108
+ #: views/admin.php:93
109
+ msgid "Order posts by:"
110
+ msgstr ""
111
+
112
+ #: views/admin.php:103
113
+ msgid "Order:"
114
+ msgstr ""
115
+
116
+ #: views/admin.php:117
117
+ msgid "Display thumbnails?"
118
+ msgstr ""
119
+
120
+ #: views/admin.php:120
121
+ msgid "Select a thumbnail size to show:"
122
+ msgstr ""
123
+
124
+ #: views/admin.php:133
125
+ msgid "Template filename:"
126
+ msgstr ""
127
+
128
+ #: views/admin.php:136
129
+ msgid "See documentation"
130
+ msgstr ""
131
+
132
+ #: views/admin.php:136
133
+ msgid "for details."
134
+ msgstr ""
135
+
136
+ #: views/widget.php:39
137
+ msgid "No post found"
138
+ msgstr ""
139
+
140
+ #. Plugin Name of the plugin/theme
141
+ msgid "Flexible Posts Widget"
142
+ msgstr ""
143
+
144
+ #. Plugin URI of the plugin/theme
145
+ msgid "http://wordpress.org/extend/plugins/flexible-posts-widget/"
146
+ msgstr ""
147
+
148
+ #. Description of the plugin/theme
149
+ msgid ""
150
+ "An advanced posts display widget with many options: get posts by post type, "
151
+ "taxonomy & term; sorting & ordering; feature images; custom templates and "
152
+ "more."
153
+ msgstr ""
154
+
155
+ #. Author of the plugin/theme
156
+ msgid "dpe415"
157
+ msgstr ""
158
+
159
+ #. Author URI of the plugin/theme
160
+ msgid "http://dpedesign.com"
161
+ msgstr ""
readme.txt CHANGED
@@ -4,14 +4,13 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: widget, widgets, posts, categories, tags, recent posts, thumbnails, custom post types, custom taxonomies, feature image
5
  Requires at least: 3.2
6
  Tested up to: 3.5.1
7
- Stable tag: 3.0.2
8
  License: GPL2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  An advanced posts display widget with many options. Display posts in your sidebars any way you'd like!
12
 
13
  == Description ==
14
-
15
  The default Recent Posts widget is exceptionally basic. I always find myself in need of a way to easily display a selection of posts from any combination post type or taxonomy. Hence, Flexible Post Widget.
16
 
17
  Flexible Posts Widget (FPW) is more than just a simple alternative to the default Recent Posts widget. With many per-instance options it is highly customizable and allows advanced users to display the resulting posts virtually any way imaginable.
@@ -19,7 +18,6 @@ Flexible Posts Widget (FPW) is more than just a simple alternative to the defaul
19
  Version 3.0 is a major enhancement as widgets can now get posts by *BOTH* post type and/or taxonomy & term as well as select *multiple* post types and terms. Previous versions of the plugin only allowed post type OR taxonomy & term queries, not both.
20
 
21
  = Features & options =
22
-
23
  * Customizable widget title
24
  * Get posts via post type(s) and/or taxonomy & term(s).
25
  * Control the number of posts displayed and the number of posts to offset.
@@ -28,15 +26,17 @@ Version 3.0 is a major enhancement as widgets can now get posts by *BOTH* post t
28
  * Order posts by: date, ID, title, menu order, random; and sort posts: ascending or descending.
29
  * Each widget's output can be customized by user-defined templates added to the current theme folder.
30
 
 
 
 
31
 
32
- == Installation ==
33
 
 
34
  1. Upload the `flexible-posts-widget` folder to the `/wp-content/plugins/` directory.
35
  1. Activate the plugin through the 'Plugins' menu in WordPress.
36
  1. Go to 'Appearance' > 'Widgets' and place the widget into a sidebar to configure it.
37
 
38
  = To use a custom HTML output template =
39
-
40
  1. Create a folder called `flexible-posts-widget` in the root of your theme folder.
41
  1. Copy `widget.php` from within the plugin's `views` folder into your theme's new `flexible-posts-widget` folder.
42
  1. Optional: Rename your theme's `widget.php` template file to a name of your choice (to use different templates for each widget instance).
@@ -45,7 +45,6 @@ Version 3.0 is a major enhancement as widgets can now get posts by *BOTH* post t
45
 
46
 
47
  == Frequently Asked Questions ==
48
-
49
  = How can I display custom fields (custom meta values) with FPW? =
50
  You'll want to create a custom HTML template by following [the instructions](http://wordpress.org/extend/plugins/flexible-posts-widget/installation/ "View instructions for creating custom FPW templates") and then you can use the standard WordPress [Custom Field](http://codex.wordpress.org/Custom_Fields "View custom field functions on the WordPress Codex") functions the same way you would if you were editing your theme's other template files.
51
 
@@ -57,14 +56,16 @@ echo $test_field_value;`
57
  FPW intentionally does NOT add any styling of it's own. To adjust the font size, color, alignment, image size, etc. of any output from this widget, you'll need to edit your theme's styles.
58
 
59
  = Does this plugin/widget insert any styles or scripts into my site? =
60
- FPW does NOT add styles or scripts to your public theme. The plugin is intentionally designed work within your existing theme. FPW does add one stylesheet and one JavaScript to Widgets page in wp-admin to help with the widget administration.
 
 
 
61
 
62
  = Questions, Support & Bug Reports =
63
- To get answers to your questions, request help or submit a bug report, please visit the forum: http://wordpress.org/tags/flexible-posts-widget/
64
 
65
 
66
  == Screenshots ==
67
-
68
  1. Configuring a Flexible Posts Widget in wp-admin with the Post Type tab displayed.
69
  1. Configuring a Flexible Posts Widget in wp-admin with the Taxonomy & Term tab displayed.
70
  1. An example of posts displayed using WordPress's TwentyTwelve theme and the default Feature Image (post-thumbnail) size. This demonstrates how the plugin looks out-of-the-box with no user-customized styling or output in a default theme.
@@ -73,38 +74,41 @@ To get answers to your questions, request help or submit a bug report, please vi
73
  1. In the wild: FPW displaying several posts over at http://chnl7700.mnsu.edu. Also highly customized output and theme styles.
74
 
75
  == Upgrade Notice ==
76
-
77
  When upgrading from one major version to another (version 1.x to version 2.x to version 3.x, etc), please remember to verify your settings for any existing widgets. Not all settings combinations will be saved after a major release upgrade.
78
 
79
 
80
  == Other Notes ==
81
-
82
  = Upgrading from one major version to another =
83
  When upgrading between major releases (version 1.x to version 2.x to version 3.x, etc), please remember to verify your settings for any existing widgets. Not all settings combinations will be saved after a major release upgrade.
84
 
85
  = Default vs. Custom Templates =
86
-
87
  FPW comes with a default template for the widget output. If you would like to alter the widget display code, create a new folder called `flexible-posts-widget` in your template directory and copy over the "views/widget.php" file.
88
 
89
  Edit the new file in your theme to your desired HTML layout. Please do not edit the one in the plugin folder as that will cause conflicts when you update the plugin to the latest release.
90
 
91
  = Future updates & feature requests list =
92
-
93
  * Dynamically populate the "Template Filename" field based on the templates available.
94
- * Adjust widget output template for Media-type posts.
95
  * Add shortcode functionality.
96
  * Allow shortcode output to dynamically load more posts (AJAX-ified).
97
 
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
 
 
101
  = 3.0.2 =
102
  * Bug fix: Added a check to make sure both taxonomy & term are set for tax queries.
103
 
104
  = 3.0.1 =
105
  * Bug fix: Not able to get all registered post types & taxonomies until after widget init. Had to reorder some code.
106
- * Bug fix: when getting post types for display in widget admin. (Props: @angelfish276).
107
-
108
 
109
  = 3.0 =
110
  * Allow widgets to query by post type and/or taxonomy & term instead of just one or the other. (Props: @vernal)
4
  Tags: widget, widgets, posts, categories, tags, recent posts, thumbnails, custom post types, custom taxonomies, feature image
5
  Requires at least: 3.2
6
  Tested up to: 3.5.1
7
+ Stable tag: 3.1.1
8
  License: GPL2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  An advanced posts display widget with many options. Display posts in your sidebars any way you'd like!
12
 
13
  == Description ==
 
14
  The default Recent Posts widget is exceptionally basic. I always find myself in need of a way to easily display a selection of posts from any combination post type or taxonomy. Hence, Flexible Post Widget.
15
 
16
  Flexible Posts Widget (FPW) is more than just a simple alternative to the default Recent Posts widget. With many per-instance options it is highly customizable and allows advanced users to display the resulting posts virtually any way imaginable.
18
  Version 3.0 is a major enhancement as widgets can now get posts by *BOTH* post type and/or taxonomy & term as well as select *multiple* post types and terms. Previous versions of the plugin only allowed post type OR taxonomy & term queries, not both.
19
 
20
  = Features & options =
 
21
  * Customizable widget title
22
  * Get posts via post type(s) and/or taxonomy & term(s).
23
  * Control the number of posts displayed and the number of posts to offset.
26
  * Order posts by: date, ID, title, menu order, random; and sort posts: ascending or descending.
27
  * Each widget's output can be customized by user-defined templates added to the current theme folder.
28
 
29
+ = Supported Languages =
30
+ * English
31
+ * Spanish
32
 
 
33
 
34
+ == Installation ==
35
  1. Upload the `flexible-posts-widget` folder to the `/wp-content/plugins/` directory.
36
  1. Activate the plugin through the 'Plugins' menu in WordPress.
37
  1. Go to 'Appearance' > 'Widgets' and place the widget into a sidebar to configure it.
38
 
39
  = To use a custom HTML output template =
 
40
  1. Create a folder called `flexible-posts-widget` in the root of your theme folder.
41
  1. Copy `widget.php` from within the plugin's `views` folder into your theme's new `flexible-posts-widget` folder.
42
  1. Optional: Rename your theme's `widget.php` template file to a name of your choice (to use different templates for each widget instance).
45
 
46
 
47
  == Frequently Asked Questions ==
 
48
  = How can I display custom fields (custom meta values) with FPW? =
49
  You'll want to create a custom HTML template by following [the instructions](http://wordpress.org/extend/plugins/flexible-posts-widget/installation/ "View instructions for creating custom FPW templates") and then you can use the standard WordPress [Custom Field](http://codex.wordpress.org/Custom_Fields "View custom field functions on the WordPress Codex") functions the same way you would if you were editing your theme's other template files.
50
 
56
  FPW intentionally does NOT add any styling of it's own. To adjust the font size, color, alignment, image size, etc. of any output from this widget, you'll need to edit your theme's styles.
57
 
58
  = Does this plugin/widget insert any styles or scripts into my site? =
59
+ FPW does not add styles or scripts to your public theme. The plugin is intentionally designed to work within your existing theme. FPW does add one stylesheet and one JavaScript to the Widgets page in wp-admin to help with the administration of any FPWs in use.
60
+
61
+ = Want to add support for another language? =
62
+ I'd love to support more languages. Feel free to post PO & MO files for your language to a [new forum thread](http://wordpress.org/tags/flexible-posts-widget/) and I'll get them added to the plugin.
63
 
64
  = Questions, Support & Bug Reports =
65
+ To get answers to your questions, request help or submit a bug report, please start a [new forum thread](http://wordpress.org/tags/flexible-posts-widget/).
66
 
67
 
68
  == Screenshots ==
 
69
  1. Configuring a Flexible Posts Widget in wp-admin with the Post Type tab displayed.
70
  1. Configuring a Flexible Posts Widget in wp-admin with the Taxonomy & Term tab displayed.
71
  1. An example of posts displayed using WordPress's TwentyTwelve theme and the default Feature Image (post-thumbnail) size. This demonstrates how the plugin looks out-of-the-box with no user-customized styling or output in a default theme.
74
  1. In the wild: FPW displaying several posts over at http://chnl7700.mnsu.edu. Also highly customized output and theme styles.
75
 
76
  == Upgrade Notice ==
 
77
  When upgrading from one major version to another (version 1.x to version 2.x to version 3.x, etc), please remember to verify your settings for any existing widgets. Not all settings combinations will be saved after a major release upgrade.
78
 
79
 
80
  == Other Notes ==
 
81
  = Upgrading from one major version to another =
82
  When upgrading between major releases (version 1.x to version 2.x to version 3.x, etc), please remember to verify your settings for any existing widgets. Not all settings combinations will be saved after a major release upgrade.
83
 
84
  = Default vs. Custom Templates =
 
85
  FPW comes with a default template for the widget output. If you would like to alter the widget display code, create a new folder called `flexible-posts-widget` in your template directory and copy over the "views/widget.php" file.
86
 
87
  Edit the new file in your theme to your desired HTML layout. Please do not edit the one in the plugin folder as that will cause conflicts when you update the plugin to the latest release.
88
 
89
  = Future updates & feature requests list =
90
+ * Add a CSS class field to be applied to each widget in a (non-existant) Advanced section.
91
  * Dynamically populate the "Template Filename" field based on the templates available.
92
+ * Add filters & hooks for other plugins.
93
  * Add shortcode functionality.
94
  * Allow shortcode output to dynamically load more posts (AJAX-ified).
95
 
96
 
97
  == Changelog ==
98
 
99
+ = 3.1.1 =
100
+ * Fixed incorrect use of rtrim in getTemplateHierarchy when getting custom template files. (Props: @mortenf)
101
+
102
+ = 3.1 =
103
+ * Internationalized and added Spanish language support. (Props: @elarequi)
104
+ * Added support for Media post types with "image/" mime types to be displayed directly in the default template.
105
+
106
  = 3.0.2 =
107
  * Bug fix: Added a check to make sure both taxonomy & term are set for tax queries.
108
 
109
  = 3.0.1 =
110
  * Bug fix: Not able to get all registered post types & taxonomies until after widget init. Had to reorder some code.
111
+ * Bug fix: when getting post types for display in widget admin. (Props: @angelfish276)
 
112
 
113
  = 3.0 =
114
  * Allow widgets to query by post type and/or taxonomy & term instead of just one or the other. (Props: @vernal)
views/admin.php CHANGED
@@ -12,13 +12,13 @@ if ( !defined('ABSPATH') )
12
 
13
  <div class="section title">
14
  <p>
15
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget title:'); ?></label>
16
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
17
  </p>
18
  </div>
19
 
20
  <div class="section getemby">
21
- <h4><?php _e('Get posts by'); ?></h4>
22
  <div class="inside">
23
 
24
  <div id="<?php echo $this->get_field_id('getemby'); ?>" class="categorydiv getembytabs">
@@ -26,8 +26,8 @@ if ( !defined('ABSPATH') )
26
  <input id="<?php echo $this->get_field_id('cur_tab'); ?>" class="cur_tab" name="<?php echo $this->get_field_name('cur_tab'); ?>" type="hidden" value="<?php echo $cur_tab; ?>" />
27
 
28
  <ul id="<?php echo $this->get_field_id('getemby-tabs'); ?>" class="category-tabs">
29
- <li><a href="#<?php echo $this->get_field_id('getemby-pt'); ?>">Post Type</a></li>
30
- <li><a href="#<?php echo $this->get_field_id('getemby-tt'); ?>">Taxonomy &amp; Term</a></li>
31
  </ul>
32
 
33
  <div id="<?php echo $this->get_field_id('getemby-pt'); ?>" class="tabs-panel pt">
@@ -36,9 +36,9 @@ if ( !defined('ABSPATH') )
36
 
37
  <div id="<?php echo $this->get_field_id('getemby-tt'); ?>" class="tabs-panel tt" style="display:none;">
38
  <p>
39
- <label for="<?php echo $this->get_field_id('taxonomy'); ?>"><?php _e('Select a taxonomy:'); ?></label>
40
  <select class="widefat dpe-fp-taxonomy" name="<?php echo $this->get_field_name('taxonomy'); ?>" id="<?php echo $this->get_field_id('taxonomy'); ?>">
41
- <option value="none" <?php echo 'none' == $taxonomy ? ' selected="selected"' : ''; ?>>Ignore Taxonomy &amp; Term</option>
42
  <?php
43
  foreach ($this->taxonomies as $option) {
44
  echo '<option value="' . $option->name . '"', $taxonomy == $option->name ? ' selected="selected"' : '', '>', $option->label, '</option>';
@@ -46,7 +46,7 @@ if ( !defined('ABSPATH') )
46
  ?>
47
  </select>
48
  </p>
49
- <label <?php echo 'none' == $taxonomy ? ' style="display:none;"' : ''; ?>><?php _e('Select terms:'); ?></label>
50
  <div class="terms" <?php echo 'none' == $taxonomy ? ' style="display:none;"' : ''; ?>>
51
  <?php
52
  if ( !empty($taxonomy) && 'none' != $taxonomy ) {
@@ -64,7 +64,7 @@ if ( !defined('ABSPATH') )
64
  }
65
  $output .= "</ul>\n";
66
  } else {
67
- $output = '<p>No terms found.</p>';
68
  }
69
 
70
  echo ( $output );
@@ -80,17 +80,17 @@ if ( !defined('ABSPATH') )
80
  </div>
81
 
82
  <div class="section display">
83
- <h4>Display options</h4>
84
  <p class="cf">
85
- <label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:'); ?></label>
86
  <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" />
87
  </p>
88
  <p class="cf">
89
- <label for="<?php echo $this->get_field_id('offset'); ?>"><?php _e('Number of posts to skip:'); ?></label>
90
  <input id="<?php echo $this->get_field_id('offset'); ?>" name="<?php echo $this->get_field_name('offset'); ?>" type="text" value="<?php echo $offset; ?>" />
91
  </p>
92
  <p class="cf">
93
- <label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e('Order posts by:'); ?></label>
94
  <select name="<?php echo $this->get_field_name('orderby'); ?>" id="<?php echo $this->get_field_id('orderby'); ?>">
95
  <?php
96
  foreach ( $this->orderbys as $key => $value ) {
@@ -100,7 +100,7 @@ if ( !defined('ABSPATH') )
100
  </select>
101
  </p>
102
  <p class="cf">
103
- <label for="<?php echo $this->get_field_id('order'); ?>"><?php _e('Order:'); ?></label>
104
  <select name="<?php echo $this->get_field_name('order'); ?>" id="<?php echo $this->get_field_id('order'); ?>">
105
  <?php
106
  foreach ( $this->orders as $key => $value ) {
@@ -114,10 +114,10 @@ if ( !defined('ABSPATH') )
114
  <div class="section thumbnails">
115
  <p style="margin-top:1.33em;">
116
  <input class="dpe-fp-thumbnail" id="<?php echo $this->get_field_id('thumbnail'); ?>" name="<?php echo $this->get_field_name('thumbnail'); ?>" type="checkbox" value="1" <?php checked( '1', $thumbnail ); ?>/>
117
- <label style="font-weight:bold;" for="<?php echo $this->get_field_id('thumbnail'); ?>"><?php _e('Display thumbnails?'); ?></label>
118
  </p>
119
  <p <?php echo $thumbnail ? '' : 'style="display:none;"'?> class="thumb-size">
120
- <label for="<?php echo $this->get_field_id('thumbsize'); ?>"><?php _e('Select a thumbnail size to show:'); ?></label>
121
  <select class="widefat" name="<?php echo $this->get_field_name('thumbsize'); ?>" id="<?php echo $this->get_field_id('thumbsize'); ?>">
122
  <?php
123
  foreach ($this->thumbsizes as $option) {
@@ -130,11 +130,11 @@ if ( !defined('ABSPATH') )
130
 
131
  <div class="section template">
132
  <p style="margin:1.33em 0;">
133
- <label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template filename:'); ?></label>
134
  <input id="<?php echo $this->get_field_id('template'); ?>" name="<?php echo $this->get_field_name('template'); ?>" type="text" value="<?php echo $template; ?>" />
135
  <br />
136
- <span style="padding-top:3px;" class="description"><a target="_blank" href="http://wordpress.org/extend/plugins/flexible-posts-widget/other_notes/">See documentation</a> for details.</span>
137
  </p>
138
  </div>
139
 
140
- </div><!-- .dpe-fp-widget -->
12
 
13
  <div class="section title">
14
  <p>
15
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget title:', 'flexible-posts-widget'); ?></label>
16
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
17
  </p>
18
  </div>
19
 
20
  <div class="section getemby">
21
+ <h4><?php _e('Get posts by', 'flexible-posts-widget'); ?></h4>
22
  <div class="inside">
23
 
24
  <div id="<?php echo $this->get_field_id('getemby'); ?>" class="categorydiv getembytabs">
26
  <input id="<?php echo $this->get_field_id('cur_tab'); ?>" class="cur_tab" name="<?php echo $this->get_field_name('cur_tab'); ?>" type="hidden" value="<?php echo $cur_tab; ?>" />
27
 
28
  <ul id="<?php echo $this->get_field_id('getemby-tabs'); ?>" class="category-tabs">
29
+ <li><a href="#<?php echo $this->get_field_id('getemby-pt'); ?>"><?php _e('Post Type', 'flexible-posts-widget'); ?></a></li>
30
+ <li><a href="#<?php echo $this->get_field_id('getemby-tt'); ?>"><?php _e('Taxonomy &amp; Term', 'flexible-posts-widget'); ?></a></li>
31
  </ul>
32
 
33
  <div id="<?php echo $this->get_field_id('getemby-pt'); ?>" class="tabs-panel pt">
36
 
37
  <div id="<?php echo $this->get_field_id('getemby-tt'); ?>" class="tabs-panel tt" style="display:none;">
38
  <p>
39
+ <label for="<?php echo $this->get_field_id('taxonomy'); ?>"><?php _e('Select a taxonomy:', 'flexible-posts-widget'); ?></label>
40
  <select class="widefat dpe-fp-taxonomy" name="<?php echo $this->get_field_name('taxonomy'); ?>" id="<?php echo $this->get_field_id('taxonomy'); ?>">
41
+ <option value="none" <?php echo 'none' == $taxonomy ? ' selected="selected"' : ''; ?>><?php _e('Ignore Taxonomy &amp; Term', 'flexible-posts-widget'); ?></option>
42
  <?php
43
  foreach ($this->taxonomies as $option) {
44
  echo '<option value="' . $option->name . '"', $taxonomy == $option->name ? ' selected="selected"' : '', '>', $option->label, '</option>';
46
  ?>
47
  </select>
48
  </p>
49
+ <label <?php echo 'none' == $taxonomy ? ' style="display:none;"' : ''; ?>><?php _e('Select terms:', 'flexible-posts-widget'); ?></label>
50
  <div class="terms" <?php echo 'none' == $taxonomy ? ' style="display:none;"' : ''; ?>>
51
  <?php
52
  if ( !empty($taxonomy) && 'none' != $taxonomy ) {
64
  }
65
  $output .= "</ul>\n";
66
  } else {
67
+ $output = '<p>' . __('No terms found.', 'flexible-posts-widget') . '</p>';
68
  }
69
 
70
  echo ( $output );
80
  </div>
81
 
82
  <div class="section display">
83
+ <h4><?php _e('Display options', 'flexible-posts-widget'); ?></h4>
84
  <p class="cf">
85
+ <label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', 'flexible-posts-widget'); ?></label>
86
  <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" />
87
  </p>
88
  <p class="cf">
89
+ <label for="<?php echo $this->get_field_id('offset'); ?>"><?php _e('Number of posts to skip:', 'flexible-posts-widget'); ?></label>
90
  <input id="<?php echo $this->get_field_id('offset'); ?>" name="<?php echo $this->get_field_name('offset'); ?>" type="text" value="<?php echo $offset; ?>" />
91
  </p>
92
  <p class="cf">
93
+ <label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e('Order posts by:', 'flexible-posts-widget'); ?></label>
94
  <select name="<?php echo $this->get_field_name('orderby'); ?>" id="<?php echo $this->get_field_id('orderby'); ?>">
95
  <?php
96
  foreach ( $this->orderbys as $key => $value ) {
100
  </select>
101
  </p>
102
  <p class="cf">
103
+ <label for="<?php echo $this->get_field_id('order'); ?>"><?php _e('Order:', 'flexible-posts-widget'); ?></label>
104
  <select name="<?php echo $this->get_field_name('order'); ?>" id="<?php echo $this->get_field_id('order'); ?>">
105
  <?php
106
  foreach ( $this->orders as $key => $value ) {
114
  <div class="section thumbnails">
115
  <p style="margin-top:1.33em;">
116
  <input class="dpe-fp-thumbnail" id="<?php echo $this->get_field_id('thumbnail'); ?>" name="<?php echo $this->get_field_name('thumbnail'); ?>" type="checkbox" value="1" <?php checked( '1', $thumbnail ); ?>/>
117
+ <label style="font-weight:bold;" for="<?php echo $this->get_field_id('thumbnail'); ?>"><?php _e('Display thumbnails?', 'flexible-posts-widget'); ?></label>
118
  </p>
119
  <p <?php echo $thumbnail ? '' : 'style="display:none;"'?> class="thumb-size">
120
+ <label for="<?php echo $this->get_field_id('thumbsize'); ?>"><?php _e('Select a thumbnail size to show:', 'flexible-posts-widget'); ?></label>
121
  <select class="widefat" name="<?php echo $this->get_field_name('thumbsize'); ?>" id="<?php echo $this->get_field_id('thumbsize'); ?>">
122
  <?php
123
  foreach ($this->thumbsizes as $option) {
130
 
131
  <div class="section template">
132
  <p style="margin:1.33em 0;">
133
+ <label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template filename:', 'flexible-posts-widget'); ?></label>
134
  <input id="<?php echo $this->get_field_id('template'); ?>" name="<?php echo $this->get_field_name('template'); ?>" type="text" value="<?php echo $template; ?>" />
135
  <br />
136
+ <span style="padding-top:3px;" class="description"><a target="_blank" href="http://wordpress.org/extend/plugins/flexible-posts-widget/other_notes/"><?php _e('See documentation', 'flexible-posts-widget'); ?></a> <?php _e('for details.', 'flexible-posts-widget'); ?></span>
137
  </p>
138
  </div>
139
 
140
+ </div><!-- .dpe-fp-widget -->
views/widget.php CHANGED
@@ -15,12 +15,19 @@ if ( !empty($title) )
15
  if( $flexible_posts->have_posts() ):
16
  ?>
17
  <ul class="dpe-flexible-posts">
18
- <?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); ?>
19
  <li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
20
  <a href="<?php echo the_permalink(); ?>">
21
  <?php
22
- if( $thumbnail == true )
23
- the_post_thumbnail( $thumbsize );
 
 
 
 
 
 
 
24
  ?>
25
  <h4 class="title"><?php the_title(); ?></h4>
26
  </a>
@@ -29,10 +36,9 @@ if( $flexible_posts->have_posts() ):
29
  </ul><!-- .dpe-flexible-posts -->
30
  <?php else: // We have no posts ?>
31
  <div class="dpe-flexible-posts no-posts">
32
- <p>No post found</p>
33
  </div>
34
  <?php
35
  endif; // End have_posts()
36
 
37
  echo $after_widget;
38
- ?>
15
  if( $flexible_posts->have_posts() ):
16
  ?>
17
  <ul class="dpe-flexible-posts">
18
+ <?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
19
  <li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
20
  <a href="<?php echo the_permalink(); ?>">
21
  <?php
22
+ if( $thumbnail == true ) {
23
+ // If the post has a feature image, show it
24
+ if( has_post_thumbnail() ) {
25
+ the_post_thumbnail( $thumbsize );
26
+ // Else if the post has a mime type that starts with "image/" then show the image directly.
27
+ } elseif( 'image/' == substr( $post->post_mime_type, 0, 6 ) ) {
28
+ echo wp_get_attachment_image( $post->ID, $thumbsize );
29
+ }
30
+ }
31
  ?>
32
  <h4 class="title"><?php the_title(); ?></h4>
33
  </a>
36
  </ul><!-- .dpe-flexible-posts -->
37
  <?php else: // We have no posts ?>
38
  <div class="dpe-flexible-posts no-posts">
39
+ <p><?php _e( 'No post found', 'flexible-posts-widget' ); ?></p>
40
  </div>
41
  <?php
42
  endif; // End have_posts()
43
 
44
  echo $after_widget;