Recent Posts Widget Extended - Version 0.9

Version Description

  • 2/19/2013 =
  • PLEASE RE-SAVE THE WIDGET
  • Fix issue with the get-the-image plugin support #10. Pros casjohnson
  • Display by date, comment count or random. new
  • Update support for WordPress 3.8
  • Minor improvement
  • Alignment issue
  • Escape title attribute in widget title
  • Set the width & height if use default thumbnail
  • Sanitize custom css
  • add 'list-style-type: none;' to the li to prevent bullet point on some themes.
  • Change numberposts with posts_per_page
  • Trim excerpt uses wp_trim_words function
  • Update language
Download this release

Release Info

Developer satrya
Plugin Icon 128x128 Recent Posts Widget Extended
Version 0.9
Comparing to
See all releases

Code changes from version 0.8.1 to 0.9

includes/widget-recent-posts-extended.php CHANGED
@@ -1,4 +1,12 @@
1
  <?php
 
 
 
 
 
 
 
 
2
  class rpwe_widget extends WP_Widget {
3
 
4
  /**
@@ -7,17 +15,17 @@ class rpwe_widget extends WP_Widget {
7
  function __construct() {
8
 
9
  $widget_ops = array(
10
- 'classname' => 'rpwe_widget recent-posts-extended',
11
- 'description' => __( 'Advanced recent posts widget.', 'rpwe' )
12
  );
13
 
14
  $control_ops = array(
15
- 'width' => 800,
16
- 'height' => 350,
17
- 'id_base' => 'rpwe_widget'
18
  );
19
 
20
- parent::__construct( 'rpwe_widget', __( '&raquo; Recent Posts Widget Extended', 'rpwe' ), $widget_ops, $control_ops );
21
 
22
  }
23
 
@@ -27,55 +35,72 @@ class rpwe_widget extends WP_Widget {
27
  function widget( $args, $instance ) {
28
  extract( $args, EXTR_SKIP );
29
 
30
- $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
31
- $title_url = $instance['title_url'];
32
- $cssID = $instance['cssID'];
33
- $limit = (int)( $instance['limit'] );
34
- $offset = (int)( $instance['offset'] );
35
- $order = $instance['order'];
36
- $excerpt = $instance['excerpt'];
37
- $length = (int)( $instance['length'] );
38
- $thumb = $instance['thumb'];
39
- $thumb_height = (int)( $instance['thumb_height'] );
40
- $thumb_width = (int)( $instance['thumb_width'] );
41
- $thumb_default = esc_url( $instance['thumb_default'] );
42
- $thumb_align = $instance['thumb_align'];
43
- $cat = $instance['cat'];
44
- $tag = $instance['tag'];
45
- $post_type = $instance['post_type'];
46
- $date = $instance['date'];
47
- $date_format = strip_tags( $instance['date_format'] );
48
- $readmore = $instance['readmore'];
49
- $readmore_text = strip_tags( $instance['readmore_text'] );
 
50
  $styles_default = $instance['styles_default'];
51
- $css = $instance['css'];
52
 
53
  echo $before_widget;
54
 
55
- if ( $styles_default == true )
 
56
  rpwe_custom_styles();
 
57
 
58
- if ( $styles_default == false && ! empty( $css ) )
 
59
  echo '<style>' . $css . '</style>';
 
60
 
61
- if ( ! empty( $title_url ) && ! empty( $title ) )
62
- echo $before_title . '<a href="' . esc_url( $title_url ) . '" title="' . $title . '">' . $title . '</a>' . $after_title;
63
- elseif ( ! empty( $title ) )
 
 
64
  echo $before_title . $title . $after_title;
 
65
 
66
  global $post;
67
 
 
68
  $args = array(
69
- 'numberposts' => $limit,
70
- 'category__in' => $cat,
71
- 'tag__in' => $tag,
72
- 'post_type' => $post_type,
73
- 'offset' => $offset,
74
- 'order' => $order
 
75
  );
76
 
77
- $default_args = apply_filters( 'rpwe_default_query_arguments', $args ); // Allow developer to filter the query.
78
- $rpwewidget = get_posts( $default_args );
 
 
 
 
 
 
 
79
 
80
  ?>
81
 
@@ -85,36 +110,65 @@ class rpwe_widget extends WP_Widget {
85
 
86
  <?php foreach ( $rpwewidget as $post ) : setup_postdata( $post ); ?>
87
 
88
- <li class="rpwe-clearfix clearfix cl">
 
 
89
 
90
- <?php if ( $thumb == true ) { ?>
91
 
92
- <?php if ( has_post_thumbnail() ) { ?>
93
  <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute('echo=0' ) ); ?>" rel="bookmark">
94
- <?php
95
- if ( current_theme_supports( 'get-the-image' ) )
96
- get_the_image( array( 'meta_key' => 'Thumbnail', 'height' => $thumb_height, 'width' => $thumb_width, 'image_class' => $thumb_align . ' rpwe-thumb', 'link_to_post' => false ) );
97
- else
98
- the_post_thumbnail( array( $thumb_height, $thumb_width ), array( 'class' => $thumb_align . ' rpwe-thumb', 'alt' => esc_attr(get_the_title() ), 'title' => esc_attr( get_the_title() ) ) );
99
- ?>
 
 
100
  </a>
101
- <?php } else { ?>
102
- <?php if ( $thumb_default ) echo '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark"><img class="' . $thumb_align . ' rpwe-thumb" src="' . $thumb_default . '" alt="' . esc_attr( get_the_title() ) . '"></a>'; ?>
103
- <?php } ?>
104
 
105
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
  <h3 class="rpwe-title">
108
  <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
109
  </h3>
110
 
111
- <?php if ( $date == true ) { ?>
112
- <time class="rpwe-time published" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>" pubdate><?php echo esc_html( get_the_date( $date_format ) ); ?></time>
113
- <?php } ?>
114
-
115
- <?php if ( $excerpt == true ) { ?>
116
- <div class="rpwe-summary"><?php echo rpwe_excerpt( $length ); ?> <?php if ( $readmore == true ) { echo '<a href="' . esc_url( get_permalink() ) . '" class="more-link">' . $readmore_text . '</a>'; } ?></div>
117
- <?php } ?>
 
 
 
118
 
119
  </li>
120
 
@@ -122,7 +176,7 @@ class rpwe_widget extends WP_Widget {
122
 
123
  </ul>
124
 
125
- </div><!-- .rpwe-block - http://wordpress.org/extend/plugins/recent-posts-widget-extended/ -->
126
 
127
  <?php
128
 
@@ -135,29 +189,30 @@ class rpwe_widget extends WP_Widget {
135
  */
136
  function update( $new_instance, $old_instance ) {
137
 
138
- $instance = $old_instance;
139
- $instance['title'] = strip_tags( $new_instance['title'] );
140
- $instance['title_url'] = esc_url_raw( $new_instance['title_url'] );
141
- $instance['cssID'] = sanitize_html_class( $new_instance['cssID'] );
142
- $instance['limit'] = (int)( $new_instance['limit'] );
143
- $instance['offset'] = (int)( $new_instance['offset'] );
144
- $instance['order'] = $new_instance['order'];
145
- $instance['excerpt'] = $new_instance['excerpt'];
146
- $instance['length'] = (int)( $new_instance['length'] );
147
- $instance['thumb'] = $new_instance['thumb'];
148
- $instance['thumb_height'] = (int)( $new_instance['thumb_height'] );
149
- $instance['thumb_width'] = (int)( $new_instance['thumb_width'] );
150
- $instance['thumb_default'] = esc_url_raw( $new_instance['thumb_default'] );
151
- $instance['thumb_align'] = $new_instance['thumb_align'];
152
- $instance['cat'] = $new_instance['cat'];
153
- $instance['tag'] = $new_instance['tag'];
154
- $instance['post_type'] = $new_instance['post_type'];
155
- $instance['date'] = $new_instance['date'];
156
- $instance['date_format'] = strip_tags( $new_instance['date_format'] );
157
- $instance['readmore'] = $new_instance['readmore'];
158
- $instance['readmore_text'] = strip_tags( $new_instance['readmore_text'] );
 
159
  $instance['styles_default'] = $new_instance['styles_default'];
160
- $instance['css'] = $new_instance['css'];
161
 
162
  return $instance;
163
 
@@ -168,57 +223,60 @@ class rpwe_widget extends WP_Widget {
168
  */
169
  function form( $instance ) {
170
 
 
171
  $css_defaults = ".rpwe-block ul{\n}\n\n.rpwe-block li{\n}\n\n.rpwe-block a{\n}\n\n.rpwe-block h3{\n}\n\n.rpwe-thumb{\n}\n\n.rpwe-summary{\n}\n\n.rpwe-time{\n}\n\n.rpwe-alignleft{\n}\n\n.rpwe-alignright{\n}\n\n.rpwe-alignnone{\n}\n\n.rpwe-clearfix:before,\n.rpwe-clearfix:after{\ncontent: \"\";\ndisplay: table;\n}\n\n.rpwe-clearfix:after{\nclear:both;\n}\n\n.rpwe-clearfix{\nzoom: 1;\n}";
172
 
173
  /* Set up some default widget settings. */
174
  $defaults = array(
175
- 'title' => '',
176
- 'title_url' => '',
177
- 'cssID' => '',
178
- 'limit' => 5,
179
- 'offset' => 0,
180
- 'order' => 'DESC',
181
- 'excerpt' => false,
182
- 'length' => 10,
183
- 'thumb' => true,
184
- 'thumb_height' => 45,
185
- 'thumb_width' => 45,
186
- 'thumb_default' => 'http://placehold.it/45x45/f0f0f0/ccc',
187
- 'thumb_align' => 'rpwe-alignleft',
188
- 'cat' => '',
189
- 'tag' => '',
190
- 'post_type' => '',
191
- 'date' => true,
192
- 'date_format' => 'F, Y',
193
- 'readmore' => false,
194
- 'readmore_text' => __( 'Read More &raquo;', 'rpwe' ),
195
- 'styles_default'=> true,
196
- 'css' => $css_defaults
 
197
  );
198
 
199
- $instance = wp_parse_args( (array)$instance, $defaults );
200
- $title = strip_tags( $instance['title'] );
201
- $title_url = esc_url( $instance['title_url'] );
202
- $cssID = sanitize_html_class( $instance['cssID'] );
203
- $limit = (int)( $instance['limit'] );
204
- $offset = (int)( $instance['offset'] );
205
- $order = $instance['order'];
206
- $excerpt = $instance['excerpt'];
207
- $length = (int)($instance['length']);
208
- $thumb = $instance['thumb'];
209
- $thumb_height = (int)( $instance['thumb_height'] );
210
- $thumb_width = (int)( $instance['thumb_width'] );
211
- $thumb_default = $instance['thumb_default'];
212
- $thumb_align = $instance['thumb_align'];
213
- $cat = $instance['cat'];
214
- $tag = $instance['tag'];
215
- $post_type = $instance['post_type'];
216
- $date = $instance['date'];
217
- $date_format = strip_tags( $instance['date_format'] );
218
- $readmore = $instance['readmore'];
219
- $readmore_text = strip_tags( $instance['readmore_text'] );
220
- $styles_default = $instance['styles_default'];
221
- $css = $instance['css'];
 
222
 
223
  ?>
224
 
@@ -265,6 +323,19 @@ class rpwe_widget extends WP_Widget {
265
  <option value="ASC" <?php selected( $order, 'ASC' ); ?>><?php _e( 'ASC', 'rpwe' ) ?></option>
266
  </select>
267
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  <p>
269
  <label for="<?php echo esc_attr( $this->get_field_id( 'cat' ) ); ?>"><?php _e( 'Limit to Category: ', 'rpwe' ); ?></label>
270
  <select class="widefat" multiple="multiple" id="<?php echo esc_attr( $this->get_field_id( 'cat' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'cat' ) ); ?>[]" style="width:100%;">
@@ -292,7 +363,7 @@ class rpwe_widget extends WP_Widget {
292
  <label for="<?php echo esc_attr( $this->get_field_id( 'post_type' ) ); ?>"><?php _e( 'Choose the Post Type: ', 'rpwe' ); ?></label>
293
  <?php /* pros Justin Tadlock - http://themehybrid.com/ */ ?>
294
  <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'post_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'post_type' ) ); ?>">
295
- <?php foreach ( get_post_types( '', 'objects' ) as $post_type ) { ?>
296
  <option value="<?php echo esc_attr( $post_type->name ); ?>" <?php selected( $instance['post_type'], $post_type->name ); ?>><?php echo esc_html( $post_type->labels->singular_name ); ?></option>
297
  <?php } ?>
298
  </select>
@@ -362,9 +433,10 @@ class rpwe_widget extends WP_Widget {
362
  }
363
 
364
  /**
365
- * Register widget.
366
  *
367
  * @since 0.1
 
368
  */
369
  function rpwe_register_widget() {
370
  register_widget( 'rpwe_widget' );
@@ -373,23 +445,17 @@ add_action( 'widgets_init', 'rpwe_register_widget' );
373
 
374
  /**
375
  * Print a custom excerpt.
376
- * http://bavotasan.com/2009/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/
377
  *
378
- * @since 0.1
 
 
379
  */
380
  function rpwe_excerpt( $length ) {
381
-
382
- $excerpt = explode( ' ', get_the_excerpt(), $length );
383
- if ( count( $excerpt ) >= $length ) {
384
- array_pop( $excerpt );
385
- $excerpt = implode( " ", $excerpt );
386
- } else {
387
- $excerpt = implode( " ", $excerpt );
388
- }
389
- $excerpt = preg_replace( '`\[[^\]]*\]`', '', $excerpt );
390
 
391
  return $excerpt;
392
-
393
  }
394
 
395
  /**
@@ -400,7 +466,7 @@ function rpwe_excerpt( $length ) {
400
  function rpwe_custom_styles() {
401
  ?>
402
  <style>
403
- .rpwe-block ul{list-style:none!important;margin-left:0!important;padding-left:0!important;}.rpwe-block li{border-bottom:1px solid #eee;margin-bottom:10px;padding-bottom:10px;}.rpwe-block a{display:inline!important;text-decoration:none;}.rpwe-block h3{background:none!important;clear:none;margin-bottom:0!important;font-weight:400;font-size:12px!important;line-height:1.5em;}.rpwe-thumb{border:1px solid #EEE!important;box-shadow:none!important;margin:2px 10px 2px 0;padding:3px!important;}.rpwe-summary{font-size:12px;}.rpwe-time{color:#bbb;font-size:11px;}.rpwe-alignleft{display:inline;float:left;}.rpwe-alignright{display:inline;float:right;}.rpwe-alignnone{display:block;float:none;}.rpwe-clearfix:before,.rpwe-clearfix:after{content:"";display:table;}.rpwe-clearfix:after{clear:both;}.rpwe-clearfix{zoom:1;}
404
  </style>
405
  <?php
406
  }
1
  <?php
2
+ /**
3
+ * The custom recent posts widget.
4
+ * This widget gives total control over the output to the user.
5
+ *
6
+ * @author Satrya
7
+ * @copyright Copyright (c) 2013, Satrya & ThemePhe
8
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
9
+ */
10
  class rpwe_widget extends WP_Widget {
11
 
12
  /**
15
  function __construct() {
16
 
17
  $widget_ops = array(
18
+ 'classname' => 'rpwe_widget recent-posts-extended',
19
+ 'description' => __( 'An advanced widget that gives you total control over the output of your site’s most recent Posts.', 'rpwe' )
20
  );
21
 
22
  $control_ops = array(
23
+ 'width' => 800,
24
+ 'height' => 350,
25
+ 'id_base' => 'rpwe_widget'
26
  );
27
 
28
+ parent::__construct( 'rpwe_widget', __( 'Recent Posts Extended', 'rpwe' ), $widget_ops, $control_ops );
29
 
30
  }
31
 
35
  function widget( $args, $instance ) {
36
  extract( $args, EXTR_SKIP );
37
 
38
+ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
39
+ $title_url = esc_url( $instance['title_url'] );
40
+ $cssID = $instance['cssID'];
41
+ $limit = (int)( $instance['limit'] );
42
+ $offset = (int)( $instance['offset'] );
43
+ $order = $instance['order'];
44
+ $orderby = $instance['orderby'];
45
+ $excerpt = $instance['excerpt'];
46
+ $length = (int)( $instance['length'] );
47
+ $thumb = $instance['thumb'];
48
+ $thumb_height = (int)( $instance['thumb_height'] );
49
+ $thumb_width = (int)( $instance['thumb_width'] );
50
+ $thumb_default = esc_url( $instance['thumb_default'] );
51
+ $thumb_align = sanitize_html_class( $instance['thumb_align'] );
52
+ $cat = $instance['cat'];
53
+ $tag = $instance['tag'];
54
+ $post_type = $instance['post_type'];
55
+ $date = $instance['date'];
56
+ $date_format = strip_tags( $instance['date_format'] );
57
+ $readmore = $instance['readmore'];
58
+ $readmore_text = strip_tags( $instance['readmore_text'] );
59
  $styles_default = $instance['styles_default'];
60
+ $css = wp_filter_nohtml_kses( $instance['css'] );
61
 
62
  echo $before_widget;
63
 
64
+ /* Display the default style of the plugin. */
65
+ if ( $styles_default == true ) {
66
  rpwe_custom_styles();
67
+ }
68
 
69
+ /* If the default style are disable then use the custom css. */
70
+ if ( $styles_default == false && ! empty( $css ) ) {
71
  echo '<style>' . $css . '</style>';
72
+ }
73
 
74
+ /* If both title and title url not empty then display the data. */
75
+ if ( ! empty( $title_url ) && ! empty( $title ) ) {
76
+ echo $before_title . '<a href="' . $title_url . '" title="' . esc_attr( $title ) . '">' . $title . '</a>' . $after_title;
77
+ /* If title not empty and title url empty then display just the title. */
78
+ } elseif ( ! empty( $title ) ) {
79
  echo $before_title . $title . $after_title;
80
+ }
81
 
82
  global $post;
83
 
84
+ /* Set up the query arguments. */
85
  $args = array(
86
+ 'posts_per_page' => $limit,
87
+ 'category__in' => $cat,
88
+ 'tag__in' => $tag,
89
+ 'post_type' => $post_type,
90
+ 'offset' => $offset,
91
+ 'order' => $order,
92
+ 'orderby' => $orderby
93
  );
94
 
95
+ /* Allow developer to filter the query. */
96
+ $default_args = apply_filters( 'rpwe_default_query_arguments', $args );
97
+
98
+ /**
99
+ * The main Query
100
+ *
101
+ * @link http://codex.wordpress.org/Function_Reference/get_posts
102
+ */
103
+ $rpwewidget = get_posts( $default_args );
104
 
105
  ?>
106
 
110
 
111
  <?php foreach ( $rpwewidget as $post ) : setup_postdata( $post ); ?>
112
 
113
+ <li class="rpwe-clearfix">
114
+
115
+ <?php if ( $thumb == true ) { // Check if the thumbnail option enable. ?>
116
 
117
+ <?php if ( has_post_thumbnail() ) { // Check If post has post thumbnail. ?>
118
 
 
119
  <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute('echo=0' ) ); ?>" rel="bookmark">
120
+ <?php the_post_thumbnail(
121
+ array( $thumb_height, $thumb_width, true ),
122
+ array(
123
+ 'class' => $thumb_align . ' rpwe-thumb the-post-thumbnail',
124
+ 'alt' => esc_attr( get_the_title() ),
125
+ 'title' => esc_attr( get_the_title() )
126
+ )
127
+ ); ?>
128
  </a>
 
 
 
129
 
130
+ <?php } elseif ( function_exists( 'get_the_image' ) ) { // Check if get-the-image plugin installed and active. ?>
131
+
132
+ <?php get_the_image( array(
133
+ 'height' => $thumb_height,
134
+ 'width' => $thumb_width,
135
+ 'size' => 'rpwe-thumbnail',
136
+ 'image_class' => $thumb_align . ' rpwe-thumb get-the-image',
137
+ 'image_scan' => true,
138
+ 'default_image' => $thumb_default
139
+ ) ); ?>
140
+
141
+ <?php } elseif ( $thumb_default ) { // Check if the default image not empty. ?>
142
+
143
+ <?php
144
+ printf( '<a href="%1$s" rel="bookmark"><img class="%2$s rpwe-thumb rpwe-default-thumb" src="%3$s" alt="%4$s" width="%5$s" height="%6$s"></a>',
145
+ esc_url( get_permalink() ),
146
+ $thumb_align,
147
+ $thumb_default,
148
+ esc_attr( get_the_title() ),
149
+ $thumb_width,
150
+ $thumb_height
151
+ );
152
+ ?>
153
+
154
+ <?php } // endif ?>
155
+
156
+ <?php } // endif ?>
157
 
158
  <h3 class="rpwe-title">
159
  <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
160
  </h3>
161
 
162
+ <?php if ( $date == true ) { // Check if the date option enable. ?>
163
+ <time class="rpwe-time published" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date( $date_format ) ); ?></time>
164
+ <?php } // endif ?>
165
+
166
+ <?php if ( $excerpt == true ) { // Check if the excerpt option enable. ?>
167
+ <div class="rpwe-summary">
168
+ <?php echo rpwe_excerpt( $length ); ?>
169
+ <?php if ( $readmore == true ) { echo '<a href="' . esc_url( get_permalink() ) . '" class="more-link">' . $readmore_text . '</a>'; } ?>
170
+ </div>
171
+ <?php } // endif ?>
172
 
173
  </li>
174
 
176
 
177
  </ul>
178
 
179
+ </div><!-- .rpwe-block - http://wordpress.org/plugins/recent-posts-widget-extended/ -->
180
 
181
  <?php
182
 
189
  */
190
  function update( $new_instance, $old_instance ) {
191
 
192
+ $instance = $old_instance;
193
+ $instance['title'] = strip_tags( $new_instance['title'] );
194
+ $instance['title_url'] = esc_url_raw( $new_instance['title_url'] );
195
+ $instance['cssID'] = sanitize_html_class( $new_instance['cssID'] );
196
+ $instance['limit'] = (int)( $new_instance['limit'] );
197
+ $instance['offset'] = (int)( $new_instance['offset'] );
198
+ $instance['order'] = $new_instance['order'];
199
+ $instance['orderby'] = $new_instance['orderby'];
200
+ $instance['excerpt'] = $new_instance['excerpt'];
201
+ $instance['length'] = (int)( $new_instance['length'] );
202
+ $instance['thumb'] = $new_instance['thumb'];
203
+ $instance['thumb_height'] = (int)( $new_instance['thumb_height'] );
204
+ $instance['thumb_width'] = (int)( $new_instance['thumb_width'] );
205
+ $instance['thumb_default'] = esc_url_raw( $new_instance['thumb_default'] );
206
+ $instance['thumb_align'] = $new_instance['thumb_align'];
207
+ $instance['cat'] = $new_instance['cat'];
208
+ $instance['tag'] = $new_instance['tag'];
209
+ $instance['post_type'] = $new_instance['post_type'];
210
+ $instance['date'] = $new_instance['date'];
211
+ $instance['date_format'] = strip_tags( $new_instance['date_format'] );
212
+ $instance['readmore'] = $new_instance['readmore'];
213
+ $instance['readmore_text'] = strip_tags( $new_instance['readmore_text'] );
214
  $instance['styles_default'] = $new_instance['styles_default'];
215
+ $instance['css'] = wp_filter_nohtml_kses( $new_instance['css'] );
216
 
217
  return $instance;
218
 
223
  */
224
  function form( $instance ) {
225
 
226
+ /* Output widget selector. */
227
  $css_defaults = ".rpwe-block ul{\n}\n\n.rpwe-block li{\n}\n\n.rpwe-block a{\n}\n\n.rpwe-block h3{\n}\n\n.rpwe-thumb{\n}\n\n.rpwe-summary{\n}\n\n.rpwe-time{\n}\n\n.rpwe-alignleft{\n}\n\n.rpwe-alignright{\n}\n\n.rpwe-alignnone{\n}\n\n.rpwe-clearfix:before,\n.rpwe-clearfix:after{\ncontent: \"\";\ndisplay: table;\n}\n\n.rpwe-clearfix:after{\nclear:both;\n}\n\n.rpwe-clearfix{\nzoom: 1;\n}";
228
 
229
  /* Set up some default widget settings. */
230
  $defaults = array(
231
+ 'title' => '',
232
+ 'title_url' => '',
233
+ 'cssID' => '',
234
+ 'limit' => 5,
235
+ 'offset' => 0,
236
+ 'order' => 'DESC',
237
+ 'orderby' => 'date',
238
+ 'excerpt' => false,
239
+ 'length' => 10,
240
+ 'thumb' => true,
241
+ 'thumb_height' => 45,
242
+ 'thumb_width' => 45,
243
+ 'thumb_default' => 'http://placehold.it/45x45/f0f0f0/ccc',
244
+ 'thumb_align' => 'rpwe-alignleft',
245
+ 'cat' => '',
246
+ 'tag' => '',
247
+ 'post_type' => '',
248
+ 'date' => true,
249
+ 'date_format' => 'F j, Y',
250
+ 'readmore' => false,
251
+ 'readmore_text' => __( 'Read More &raquo;', 'rpwe' ),
252
+ 'styles_default' => true,
253
+ 'css' => $css_defaults
254
  );
255
 
256
+ $instance = wp_parse_args( (array)$instance, $defaults );
257
+ $title = strip_tags( $instance['title'] );
258
+ $title_url = esc_url( $instance['title_url'] );
259
+ $cssID = sanitize_html_class( $instance['cssID'] );
260
+ $limit = (int)( $instance['limit'] );
261
+ $offset = (int)( $instance['offset'] );
262
+ $order = $instance['order'];
263
+ $orderby = $instance['orderby'];
264
+ $excerpt = $instance['excerpt'];
265
+ $length = (int)($instance['length']);
266
+ $thumb = $instance['thumb'];
267
+ $thumb_height = (int)( $instance['thumb_height'] );
268
+ $thumb_width = (int)( $instance['thumb_width'] );
269
+ $thumb_default = $instance['thumb_default'];
270
+ $thumb_align = $instance['thumb_align'];
271
+ $cat = $instance['cat'];
272
+ $tag = $instance['tag'];
273
+ $post_type = $instance['post_type'];
274
+ $date = $instance['date'];
275
+ $date_format = strip_tags( $instance['date_format'] );
276
+ $readmore = $instance['readmore'];
277
+ $readmore_text = strip_tags( $instance['readmore_text'] );
278
+ $styles_default = $instance['styles_default'];
279
+ $css = wp_filter_nohtml_kses( $instance['css'] );
280
 
281
  ?>
282
 
323
  <option value="ASC" <?php selected( $order, 'ASC' ); ?>><?php _e( 'ASC', 'rpwe' ) ?></option>
324
  </select>
325
  </p>
326
+ <p>
327
+ <label for="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>"><?php _e( 'Orderby:', 'rpwe' ); ?></label>
328
+ <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'orderby' ) ); ?>" style="width:100%;">
329
+ <option value="ID" <?php selected( $orderby, 'ID' ); ?>><?php _e( 'ID', 'rpwe' ) ?></option>
330
+ <option value="author" <?php selected( $orderby, 'author' ); ?>><?php _e( 'Author', 'rpwe' ) ?></option>
331
+ <option value="title" <?php selected( $orderby, 'title' ); ?>><?php _e( 'Title', 'rpwe' ) ?></option>
332
+ <option value="date" <?php selected( $orderby, 'date' ); ?>><?php _e( 'Date', 'rpwe' ) ?></option>
333
+ <option value="modified" <?php selected( $orderby, 'modified' ); ?>><?php _e( 'Modified', 'rpwe' ) ?></option>
334
+ <option value="rand" <?php selected( $orderby, 'rand' ); ?>><?php _e( 'Random', 'rpwe' ) ?></option>
335
+ <option value="comment_count" <?php selected( $orderby, 'comment_count' ); ?>><?php _e( 'Comment Count', 'rpwe' ) ?></option>
336
+ <option value="menu_order" <?php selected( $orderby, 'menu_order' ); ?>><?php _e( 'Menu Order', 'rpwe' ) ?></option>
337
+ </select>
338
+ </p>
339
  <p>
340
  <label for="<?php echo esc_attr( $this->get_field_id( 'cat' ) ); ?>"><?php _e( 'Limit to Category: ', 'rpwe' ); ?></label>
341
  <select class="widefat" multiple="multiple" id="<?php echo esc_attr( $this->get_field_id( 'cat' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'cat' ) ); ?>[]" style="width:100%;">
363
  <label for="<?php echo esc_attr( $this->get_field_id( 'post_type' ) ); ?>"><?php _e( 'Choose the Post Type: ', 'rpwe' ); ?></label>
364
  <?php /* pros Justin Tadlock - http://themehybrid.com/ */ ?>
365
  <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'post_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'post_type' ) ); ?>">
366
+ <?php foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $post_type ) { ?>
367
  <option value="<?php echo esc_attr( $post_type->name ); ?>" <?php selected( $instance['post_type'], $post_type->name ); ?>><?php echo esc_html( $post_type->labels->singular_name ); ?></option>
368
  <?php } ?>
369
  </select>
433
  }
434
 
435
  /**
436
+ * Register the widget.
437
  *
438
  * @since 0.1
439
+ * @link http://codex.wordpress.org/Function_Reference/register_widget
440
  */
441
  function rpwe_register_widget() {
442
  register_widget( 'rpwe_widget' );
445
 
446
  /**
447
  * Print a custom excerpt.
448
+ * Code revision in version 0.9, uses wp_trim_words function
449
  *
450
+ * @since 0.1
451
+ * @version 0.9
452
+ * @link http://codex.wordpress.org/Function_Reference/wp_trim_words
453
  */
454
  function rpwe_excerpt( $length ) {
455
+ $content = get_the_excerpt();
456
+ $excerpt = wp_trim_words( $content, $length );
 
 
 
 
 
 
 
457
 
458
  return $excerpt;
 
459
  }
460
 
461
  /**
466
  function rpwe_custom_styles() {
467
  ?>
468
  <style>
469
+ .rpwe-block ul{list-style:none!important;margin-left:0!important;padding-left:0!important;}.rpwe-block li{border-bottom:1px solid #eee;margin-bottom:10px;padding-bottom:10px;list-style-type: none;}.rpwe-block a{display:inline!important;text-decoration:none;}.rpwe-block h3{background:none!important;clear:none;margin-bottom:0!important;margin-top:0!important;font-weight:400;font-size:12px!important;line-height:1.5em;}.rpwe-thumb{border:1px solid #EEE!important;box-shadow:none!important;margin:2px 10px 2px 0;padding:3px!important;}.rpwe-summary{font-size:12px;}.rpwe-time{color:#bbb;font-size:11px;}.rpwe-alignleft{display:inline;float:left;}.rpwe-alignright{display:inline;float:right;}.rpwe-alignnone{display:block;float:none;}.rpwe-clearfix:before,.rpwe-clearfix:after{content:"";display:table !important;}.rpwe-clearfix:after{clear:both;}.rpwe-clearfix{zoom:1;}
470
  </style>
471
  <?php
472
  }
languages/rpwe.mo CHANGED
Binary file
languages/rpwe.po CHANGED
@@ -1,148 +1,186 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Recent Posts Widget Extended 0.6\n"
4
- "POT-Creation-Date: 2013-08-14 12:54+0700\n"
5
- "PO-Revision-Date: 2013-08-14 12:54+0700\n"
6
- "Last-Translator: M.Satrya <satrya@tokokoo.com>\n"
7
  "Language-Team: Satrya <satrya@tokokoo.com>\n"
8
- "Language: English\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.5.7\n"
13
  "X-Poedit-KeywordsList: __;_e;esc_attr__\n"
14
  "X-Poedit-Basepath: .\n"
15
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
19
- #: ../includes/widget-recent-posts-extended.php:11
20
- msgid "Advanced recent posts widget."
 
 
21
  msgstr ""
22
 
23
- #: ../includes/widget-recent-posts-extended.php:20
24
- msgid "&raquo; Recent Posts Widget Extended"
25
  msgstr ""
26
 
27
- #: ../includes/widget-recent-posts-extended.php:93
28
- #: ../includes/widget-recent-posts-extended.php:107
29
  #, php-format
30
  msgid "Permalink to %s"
31
  msgstr ""
32
 
33
- #: ../includes/widget-recent-posts-extended.php:193
34
  msgid "Read More &raquo;"
35
  msgstr ""
36
 
37
- #: ../includes/widget-recent-posts-extended.php:227
38
  msgid "Title:"
39
  msgstr ""
40
 
41
- #: ../includes/widget-recent-posts-extended.php:231
42
  msgid "Title URL:"
43
  msgstr ""
44
 
45
- #: ../includes/widget-recent-posts-extended.php:235
46
  msgid "CSS ID:"
47
  msgstr ""
48
 
49
- #: ../includes/widget-recent-posts-extended.php:239
50
  msgid "Use Default Styles"
51
  msgstr ""
52
 
53
- #: ../includes/widget-recent-posts-extended.php:243
54
  msgid "CSS:"
55
  msgstr ""
56
 
57
- #: ../includes/widget-recent-posts-extended.php:245
58
  msgid "If you turn off the default styles, please create your own style."
59
  msgstr ""
60
 
61
- #: ../includes/widget-recent-posts-extended.php:253
62
  msgid "Limit:"
63
  msgstr ""
64
 
65
- #: ../includes/widget-recent-posts-extended.php:257
66
  msgid "Offset (the number of posts to skip):"
67
  msgstr ""
68
 
69
- #: ../includes/widget-recent-posts-extended.php:261
70
  msgid "Order:"
71
  msgstr ""
72
 
73
- #: ../includes/widget-recent-posts-extended.php:263
74
  msgid "DESC"
75
  msgstr ""
76
 
77
- #: ../includes/widget-recent-posts-extended.php:264
78
  msgid "ASC"
79
  msgstr ""
80
 
81
- #: ../includes/widget-recent-posts-extended.php:268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  msgid "Limit to Category: "
83
  msgstr ""
84
 
85
- #: ../includes/widget-recent-posts-extended.php:279
86
  msgid "Limit to Tag: "
87
  msgstr ""
88
 
89
- #: ../includes/widget-recent-posts-extended.php:291
90
  msgid "Choose the Post Type: "
91
  msgstr ""
92
 
93
- #: ../includes/widget-recent-posts-extended.php:307
94
  msgid "Display Thumbnail"
95
  msgstr ""
96
 
97
- #: ../includes/widget-recent-posts-extended.php:311
98
  msgid "Thumbnail (height, width, align):"
99
  msgstr ""
100
 
101
- #: ../includes/widget-recent-posts-extended.php:315
102
  msgid "Left"
103
  msgstr ""
104
 
105
- #: ../includes/widget-recent-posts-extended.php:316
106
  msgid "Right"
107
  msgstr ""
108
 
109
- #: ../includes/widget-recent-posts-extended.php:317
110
  msgid "Center"
111
  msgstr ""
112
 
113
- #: ../includes/widget-recent-posts-extended.php:321
114
  msgid "Default Thumbnail:"
115
  msgstr ""
116
 
117
- #: ../includes/widget-recent-posts-extended.php:323
118
  msgid "Leave it blank to disable."
119
  msgstr ""
120
 
121
- #: ../includes/widget-recent-posts-extended.php:329
122
  msgid "Display Excerpt"
123
  msgstr ""
124
 
125
- #: ../includes/widget-recent-posts-extended.php:333
126
  msgid "Excerpt Length:"
127
  msgstr ""
128
 
129
- #: ../includes/widget-recent-posts-extended.php:337
130
  msgid "Display Readmore"
131
  msgstr ""
132
 
133
- #: ../includes/widget-recent-posts-extended.php:341
134
  msgid "Readmore Text:"
135
  msgstr ""
136
 
137
- #: ../includes/widget-recent-posts-extended.php:345
138
  msgid "Display Date"
139
  msgstr ""
140
 
141
- #: ../includes/widget-recent-posts-extended.php:349
142
  msgid "Date Format:"
143
  msgstr ""
144
 
145
- #: ../includes/widget-recent-posts-extended.php:351
146
  msgid ""
147
  "<a href=\"http://codex.wordpress.org/Formatting_Date_and_Time\" target="
148
  "\"_blank\">Date reference</a>"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Recent Posts Widget Extended 0.6\n"
4
+ "POT-Creation-Date: 2014-02-19 18:34+0700\n"
5
+ "PO-Revision-Date: 2014-02-19 18:35+0700\n"
6
+ "Last-Translator: Satrya <satrya@satrya.me>\n"
7
  "Language-Team: Satrya <satrya@tokokoo.com>\n"
8
+ "Language: en\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.3\n"
13
  "X-Poedit-KeywordsList: __;_e;esc_attr__\n"
14
  "X-Poedit-Basepath: .\n"
15
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
19
+ #: ../includes/widget-recent-posts-extended.php:19
20
+ msgid ""
21
+ "An advanced widget that gives you total control over the output of your "
22
+ "site’s most recent Posts."
23
  msgstr ""
24
 
25
+ #: ../includes/widget-recent-posts-extended.php:28
26
+ msgid "Recent Posts Extended"
27
  msgstr ""
28
 
29
+ #: ../includes/widget-recent-posts-extended.php:119
30
+ #: ../includes/widget-recent-posts-extended.php:159
31
  #, php-format
32
  msgid "Permalink to %s"
33
  msgstr ""
34
 
35
+ #: ../includes/widget-recent-posts-extended.php:251
36
  msgid "Read More &raquo;"
37
  msgstr ""
38
 
39
+ #: ../includes/widget-recent-posts-extended.php:286
40
  msgid "Title:"
41
  msgstr ""
42
 
43
+ #: ../includes/widget-recent-posts-extended.php:290
44
  msgid "Title URL:"
45
  msgstr ""
46
 
47
+ #: ../includes/widget-recent-posts-extended.php:294
48
  msgid "CSS ID:"
49
  msgstr ""
50
 
51
+ #: ../includes/widget-recent-posts-extended.php:298
52
  msgid "Use Default Styles"
53
  msgstr ""
54
 
55
+ #: ../includes/widget-recent-posts-extended.php:302
56
  msgid "CSS:"
57
  msgstr ""
58
 
59
+ #: ../includes/widget-recent-posts-extended.php:304
60
  msgid "If you turn off the default styles, please create your own style."
61
  msgstr ""
62
 
63
+ #: ../includes/widget-recent-posts-extended.php:312
64
  msgid "Limit:"
65
  msgstr ""
66
 
67
+ #: ../includes/widget-recent-posts-extended.php:316
68
  msgid "Offset (the number of posts to skip):"
69
  msgstr ""
70
 
71
+ #: ../includes/widget-recent-posts-extended.php:320
72
  msgid "Order:"
73
  msgstr ""
74
 
75
+ #: ../includes/widget-recent-posts-extended.php:322
76
  msgid "DESC"
77
  msgstr ""
78
 
79
+ #: ../includes/widget-recent-posts-extended.php:323
80
  msgid "ASC"
81
  msgstr ""
82
 
83
+ #: ../includes/widget-recent-posts-extended.php:327
84
+ msgid "Orderby:"
85
+ msgstr ""
86
+
87
+ #: ../includes/widget-recent-posts-extended.php:329
88
+ msgid "ID"
89
+ msgstr ""
90
+
91
+ #: ../includes/widget-recent-posts-extended.php:330
92
+ msgid "Author"
93
+ msgstr ""
94
+
95
+ #: ../includes/widget-recent-posts-extended.php:331
96
+ msgid "Title"
97
+ msgstr ""
98
+
99
+ #: ../includes/widget-recent-posts-extended.php:332
100
+ msgid "Date"
101
+ msgstr ""
102
+
103
+ #: ../includes/widget-recent-posts-extended.php:333
104
+ msgid "Modified"
105
+ msgstr ""
106
+
107
+ #: ../includes/widget-recent-posts-extended.php:334
108
+ msgid "Random"
109
+ msgstr ""
110
+
111
+ #: ../includes/widget-recent-posts-extended.php:335
112
+ msgid "Comment Count"
113
+ msgstr ""
114
+
115
+ #: ../includes/widget-recent-posts-extended.php:336
116
+ msgid "Menu Order"
117
+ msgstr ""
118
+
119
+ #: ../includes/widget-recent-posts-extended.php:340
120
  msgid "Limit to Category: "
121
  msgstr ""
122
 
123
+ #: ../includes/widget-recent-posts-extended.php:351
124
  msgid "Limit to Tag: "
125
  msgstr ""
126
 
127
+ #: ../includes/widget-recent-posts-extended.php:363
128
  msgid "Choose the Post Type: "
129
  msgstr ""
130
 
131
+ #: ../includes/widget-recent-posts-extended.php:379
132
  msgid "Display Thumbnail"
133
  msgstr ""
134
 
135
+ #: ../includes/widget-recent-posts-extended.php:383
136
  msgid "Thumbnail (height, width, align):"
137
  msgstr ""
138
 
139
+ #: ../includes/widget-recent-posts-extended.php:387
140
  msgid "Left"
141
  msgstr ""
142
 
143
+ #: ../includes/widget-recent-posts-extended.php:388
144
  msgid "Right"
145
  msgstr ""
146
 
147
+ #: ../includes/widget-recent-posts-extended.php:389
148
  msgid "Center"
149
  msgstr ""
150
 
151
+ #: ../includes/widget-recent-posts-extended.php:393
152
  msgid "Default Thumbnail:"
153
  msgstr ""
154
 
155
+ #: ../includes/widget-recent-posts-extended.php:395
156
  msgid "Leave it blank to disable."
157
  msgstr ""
158
 
159
+ #: ../includes/widget-recent-posts-extended.php:401
160
  msgid "Display Excerpt"
161
  msgstr ""
162
 
163
+ #: ../includes/widget-recent-posts-extended.php:405
164
  msgid "Excerpt Length:"
165
  msgstr ""
166
 
167
+ #: ../includes/widget-recent-posts-extended.php:409
168
  msgid "Display Readmore"
169
  msgstr ""
170
 
171
+ #: ../includes/widget-recent-posts-extended.php:413
172
  msgid "Readmore Text:"
173
  msgstr ""
174
 
175
+ #: ../includes/widget-recent-posts-extended.php:417
176
  msgid "Display Date"
177
  msgstr ""
178
 
179
+ #: ../includes/widget-recent-posts-extended.php:421
180
  msgid "Date Format:"
181
  msgstr ""
182
 
183
+ #: ../includes/widget-recent-posts-extended.php:423
184
  msgid ""
185
  "<a href=\"http://codex.wordpress.org/Formatting_Date_and_Time\" target="
186
  "\"_blank\">Date reference</a>"
languages/rpwe.pot ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Recent Posts Widget Extended 0.6\n"
4
+ "POT-Creation-Date: 2014-02-19 18:34+0700\n"
5
+ "PO-Revision-Date: 2014-02-19 18:35+0700\n"
6
+ "Last-Translator: Satrya <satrya@satrya.me>\n"
7
+ "Language-Team: Satrya <satrya@tokokoo.com>\n"
8
+ "Language: en\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.3\n"
13
+ "X-Poedit-KeywordsList: __;_e;esc_attr__\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+
19
+ #: ../includes/widget-recent-posts-extended.php:19
20
+ msgid ""
21
+ "An advanced widget that gives you total control over the output of your "
22
+ "site’s most recent Posts."
23
+ msgstr ""
24
+
25
+ #: ../includes/widget-recent-posts-extended.php:28
26
+ msgid "Recent Posts Extended"
27
+ msgstr ""
28
+
29
+ #: ../includes/widget-recent-posts-extended.php:119
30
+ #: ../includes/widget-recent-posts-extended.php:159
31
+ #, php-format
32
+ msgid "Permalink to %s"
33
+ msgstr ""
34
+
35
+ #: ../includes/widget-recent-posts-extended.php:251
36
+ msgid "Read More &raquo;"
37
+ msgstr ""
38
+
39
+ #: ../includes/widget-recent-posts-extended.php:286
40
+ msgid "Title:"
41
+ msgstr ""
42
+
43
+ #: ../includes/widget-recent-posts-extended.php:290
44
+ msgid "Title URL:"
45
+ msgstr ""
46
+
47
+ #: ../includes/widget-recent-posts-extended.php:294
48
+ msgid "CSS ID:"
49
+ msgstr ""
50
+
51
+ #: ../includes/widget-recent-posts-extended.php:298
52
+ msgid "Use Default Styles"
53
+ msgstr ""
54
+
55
+ #: ../includes/widget-recent-posts-extended.php:302
56
+ msgid "CSS:"
57
+ msgstr ""
58
+
59
+ #: ../includes/widget-recent-posts-extended.php:304
60
+ msgid "If you turn off the default styles, please create your own style."
61
+ msgstr ""
62
+
63
+ #: ../includes/widget-recent-posts-extended.php:312
64
+ msgid "Limit:"
65
+ msgstr ""
66
+
67
+ #: ../includes/widget-recent-posts-extended.php:316
68
+ msgid "Offset (the number of posts to skip):"
69
+ msgstr ""
70
+
71
+ #: ../includes/widget-recent-posts-extended.php:320
72
+ msgid "Order:"
73
+ msgstr ""
74
+
75
+ #: ../includes/widget-recent-posts-extended.php:322
76
+ msgid "DESC"
77
+ msgstr ""
78
+
79
+ #: ../includes/widget-recent-posts-extended.php:323
80
+ msgid "ASC"
81
+ msgstr ""
82
+
83
+ #: ../includes/widget-recent-posts-extended.php:327
84
+ msgid "Orderby:"
85
+ msgstr ""
86
+
87
+ #: ../includes/widget-recent-posts-extended.php:329
88
+ msgid "ID"
89
+ msgstr ""
90
+
91
+ #: ../includes/widget-recent-posts-extended.php:330
92
+ msgid "Author"
93
+ msgstr ""
94
+
95
+ #: ../includes/widget-recent-posts-extended.php:331
96
+ msgid "Title"
97
+ msgstr ""
98
+
99
+ #: ../includes/widget-recent-posts-extended.php:332
100
+ msgid "Date"
101
+ msgstr ""
102
+
103
+ #: ../includes/widget-recent-posts-extended.php:333
104
+ msgid "Modified"
105
+ msgstr ""
106
+
107
+ #: ../includes/widget-recent-posts-extended.php:334
108
+ msgid "Random"
109
+ msgstr ""
110
+
111
+ #: ../includes/widget-recent-posts-extended.php:335
112
+ msgid "Comment Count"
113
+ msgstr ""
114
+
115
+ #: ../includes/widget-recent-posts-extended.php:336
116
+ msgid "Menu Order"
117
+ msgstr ""
118
+
119
+ #: ../includes/widget-recent-posts-extended.php:340
120
+ msgid "Limit to Category: "
121
+ msgstr ""
122
+
123
+ #: ../includes/widget-recent-posts-extended.php:351
124
+ msgid "Limit to Tag: "
125
+ msgstr ""
126
+
127
+ #: ../includes/widget-recent-posts-extended.php:363
128
+ msgid "Choose the Post Type: "
129
+ msgstr ""
130
+
131
+ #: ../includes/widget-recent-posts-extended.php:379
132
+ msgid "Display Thumbnail"
133
+ msgstr ""
134
+
135
+ #: ../includes/widget-recent-posts-extended.php:383
136
+ msgid "Thumbnail (height, width, align):"
137
+ msgstr ""
138
+
139
+ #: ../includes/widget-recent-posts-extended.php:387
140
+ msgid "Left"
141
+ msgstr ""
142
+
143
+ #: ../includes/widget-recent-posts-extended.php:388
144
+ msgid "Right"
145
+ msgstr ""
146
+
147
+ #: ../includes/widget-recent-posts-extended.php:389
148
+ msgid "Center"
149
+ msgstr ""
150
+
151
+ #: ../includes/widget-recent-posts-extended.php:393
152
+ msgid "Default Thumbnail:"
153
+ msgstr ""
154
+
155
+ #: ../includes/widget-recent-posts-extended.php:395
156
+ msgid "Leave it blank to disable."
157
+ msgstr ""
158
+
159
+ #: ../includes/widget-recent-posts-extended.php:401
160
+ msgid "Display Excerpt"
161
+ msgstr ""
162
+
163
+ #: ../includes/widget-recent-posts-extended.php:405
164
+ msgid "Excerpt Length:"
165
+ msgstr ""
166
+
167
+ #: ../includes/widget-recent-posts-extended.php:409
168
+ msgid "Display Readmore"
169
+ msgstr ""
170
+
171
+ #: ../includes/widget-recent-posts-extended.php:413
172
+ msgid "Readmore Text:"
173
+ msgstr ""
174
+
175
+ #: ../includes/widget-recent-posts-extended.php:417
176
+ msgid "Display Date"
177
+ msgstr ""
178
+
179
+ #: ../includes/widget-recent-posts-extended.php:421
180
+ msgid "Date Format:"
181
+ msgstr ""
182
+
183
+ #: ../includes/widget-recent-posts-extended.php:423
184
+ msgid ""
185
+ "<a href=\"http://codex.wordpress.org/Formatting_Date_and_Time\" target="
186
+ "\"_blank\">Date reference</a>"
187
+ msgstr ""
readme.txt CHANGED
@@ -1,9 +1,10 @@
1
  === Plugin Name ===
2
- Contributors: tokokoo, satrya, davidkryzaniak
 
3
  Tags: recent posts, thumbnails, widget, widgets, sidebar, excerpt, category, post tag, post type, multiple widgets
4
  Requires at least: 3.4
5
- Tested up to: 3.6
6
- Stable tag: 0.8.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -17,7 +18,9 @@ This plugin will enable a custom, flexible and super advanced recent posts widge
17
 
18
  = Features Include: =
19
 
 
20
  * You can set the title url.
 
21
  * Display thumbnails, with customizable size and alignment.
22
  * Display excerpt, with customizable length.
23
  * Display from all, specific or multiple category.
@@ -26,45 +29,68 @@ This plugin will enable a custom, flexible and super advanced recent posts widge
26
  * Default thumbnail.
27
  * Read more option.
28
  * Post type option.
29
- * Support `get_the_image` function.
30
  * Custom CSS
31
  * Multiple widgets.
 
32
 
33
  = Ugly Image Sizes =
34
 
35
  This plugin creates custom image sizes. If you use images that were uploaded to the media library before you installed this plugin, please install [Regenerate Thumbnails](http://wordpress.org/extend/plugins/regenerate-thumbnails/) plugin to corrected the sizes.
36
 
37
- = Support: =
38
- 1. Go to [forum support](http://wordpress.org/support/plugin/recent-posts-widget-extended).
39
- 2. [Open issue on github](https://github.com/tokokoo/recent-posts-widget-extended/issues).
40
- 3. [Rate/Review the plugin](http://wordpress.org/support/view/plugin-reviews/recent-posts-widget-extended).
41
 
42
- = Plugin Info: =
43
- * Developed by [Tokokoo Team](http://tokokoo.com)
44
- * Follow us on Twitter to keep up with the latest updates [@tokokoo](http://twitter.com/tokokoo)
 
45
 
46
- Be sure to check out our latest [premium ecommerce themes](http://tokokoo.com/tokokoo-themes/)
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  == Installation ==
49
 
50
  1. Upload the 'recent-posts-widget-extended' folder to the `/wp-content/plugins/` directory
51
  2. Activate the plugin through the 'Plugins' menu in WordPress
52
- 3. Go to the widgets page.
53
 
54
  == Frequently Asked Questions ==
55
 
56
  = How to filter the query from this plugin =
57
-
58
  You can use `rpwe_default_query_arguments`
59
 
 
 
 
60
  == Screenshots ==
61
 
62
  1. The widget settings
63
 
64
  == Changelog ==
65
 
66
- = 0.8.1 =
67
- * Fix not uploaded admin.css
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
  = 0.8 =
70
  * PLEASE RE-SAVE THE WIDGET
1
  === Plugin Name ===
2
+ Contributors: satrya, themephe, davidkryzaniak
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D7VPMAPHA98LW
4
  Tags: recent posts, thumbnails, widget, widgets, sidebar, excerpt, category, post tag, post type, multiple widgets
5
  Requires at least: 3.4
6
+ Tested up to: 3.8.1
7
+ Stable tag: 0.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
18
 
19
  = Features Include: =
20
 
21
+ * WordPress 3.8.1 Support.
22
  * You can set the title url.
23
+ * **Display by date, comment count or random.** *new*
24
  * Display thumbnails, with customizable size and alignment.
25
  * Display excerpt, with customizable length.
26
  * Display from all, specific or multiple category.
29
  * Default thumbnail.
30
  * Read more option.
31
  * Post type option.
 
32
  * Custom CSS
33
  * Multiple widgets.
34
+ * Support [Get the Image](http://wordpress.org/plugins/get-the-image/) plugin.
35
 
36
  = Ugly Image Sizes =
37
 
38
  This plugin creates custom image sizes. If you use images that were uploaded to the media library before you installed this plugin, please install [Regenerate Thumbnails](http://wordpress.org/extend/plugins/regenerate-thumbnails/) plugin to corrected the sizes.
39
 
40
+ = Tested Themes =
 
 
 
41
 
42
+ * [Twenty Eleven](http://wordpress.org/themes/twentyeleven)
43
+ * [Twenty Twelve](http://wordpress.org/themes/twentytwelve)
44
+ * [Twenty Fourteen](http://wordpress.org/themes/twentyfourteen)
45
+ * [Stargazer](http://wordpress.org/themes/stargazer)
46
 
47
+ = Support =
48
+
49
+ * Go to [forum support](http://wordpress.org/support/plugin/recent-posts-widget-extended).
50
+ * [Open issue on github](https://github.com/satrya/recent-posts-widget-extended).
51
+ * [Rate/Review the plugin](http://wordpress.org/support/view/plugin-reviews/recent-posts-widget-extended).
52
+
53
+ = Plugin Info =
54
+ * Developed by [Satrya](http://themephe.com)
55
+ * Follow us on Twitter to keep up with the latest updates [@themephe](http://twitter.com/themephe)
56
+
57
+ = Donations =
58
+ If you want to buy me a cup of coffee, you can do by visiting [this page](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D7VPMAPHA98LW). I appreciate all donations, no matter the size.
59
 
60
  == Installation ==
61
 
62
  1. Upload the 'recent-posts-widget-extended' folder to the `/wp-content/plugins/` directory
63
  2. Activate the plugin through the 'Plugins' menu in WordPress
64
+ 3. Go to the widgets page **Appearance -> Widgets**.
65
 
66
  == Frequently Asked Questions ==
67
 
68
  = How to filter the query from this plugin =
 
69
  You can use `rpwe_default_query_arguments`
70
 
71
+ = Thumbnail size option not working properly =
72
+ Yes, this is because the plugin uses `the_post_thumbnail` custom sizes and not uses `add_image_size` function, [more information](http://codex.wordpress.org/Function_Reference/the_post_thumbnail). At the moment I have no idea how to fix this issue.
73
+
74
  == Screenshots ==
75
 
76
  1. The widget settings
77
 
78
  == Changelog ==
79
 
80
+ = 0.9 - 2/19/2013 =
81
+ * PLEASE RE-SAVE THE WIDGET
82
+ * Fix issue with the get-the-image plugin support [#10](https://github.com/satrya/recent-posts-widget-extended/issues/10). Pros casjohnson
83
+ * Display by date, comment count or random. *new*
84
+ * Update support for WordPress 3.8
85
+ * Minor improvement
86
+ * Alignment issue
87
+ * Escape title attribute in widget title
88
+ * Set the width & height if use default thumbnail
89
+ * Sanitize custom css
90
+ * add 'list-style-type: none;' to the `li` to prevent bullet point on some themes.
91
+ * Change `numberposts` with `posts_per_page`
92
+ * Trim excerpt uses `wp_trim_words` function
93
+ * Update language
94
 
95
  = 0.8 =
96
  * PLEASE RE-SAVE THE WIDGET
rpwe.php CHANGED
@@ -1,14 +1,27 @@
1
  <?php
2
- /*
3
- Plugin Name: Recent Posts Widget Extended
4
- Plugin URI: http://wordpress.org/plugins/recent-posts-widget-extended/
5
- Description: Enables recent posts widget with advanced settings.
6
- Version: 0.8.1
7
- Author: Satrya
8
- Author URI: http://tokokoo.com
9
- Author Email: satrya@tokokoo.com
10
- License: GPLv2
11
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  // Exit if accessed directly
14
  if ( ! defined( 'ABSPATH' ) ) exit;
@@ -55,7 +68,6 @@ class RPW_Extended {
55
  * @since 0.1
56
  */
57
  public function i18n() {
58
- /* Load the translation of the plugin. */
59
  load_plugin_textdomain( 'rpwe', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
60
  }
61
 
1
  <?php
2
+ /**
3
+ * Plugin Name: Recent Posts Widget Extended
4
+ * Plugin URI: http://wordpress.org/plugins/recent-posts-widget-extended/
5
+ * Description: Enables advanced widget that gives you total control over the output of your site’s most recent Posts.
6
+ * Version: 0.9
7
+ * Author: Satrya
8
+ * Author URI: http://themephe.com/
9
+ * Author Email: satrya@themephe.com
10
+ *
11
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
12
+ * General Public License as published by the Free Software Foundation; either version 2 of the License,
13
+ * or (at your option) any later version.
14
+ *
15
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
16
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
+ *
18
+ * You should have received a copy of the GNU General Public License along with this program; if not, write
19
+ * to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
+ *
21
+ * @author Satrya
22
+ * @copyright Copyright (c) 2013, Satrya & ThemePhe
23
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24
+ */
25
 
26
  // Exit if accessed directly
27
  if ( ! defined( 'ABSPATH' ) ) exit;
68
  * @since 0.1
69
  */
70
  public function i18n() {
 
71
  load_plugin_textdomain( 'rpwe', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
72
  }
73
 
screenshot-1.png CHANGED
Binary file