Recent Posts Widget Extended - Version 0.8

Version Description

  • PLEASE RE-SAVE THE WIDGET
  • Remove caching system, it causing some issues
  • Change Limit option to input text rather than selectbox
  • Add rpwe_default_query_arguments filter to allow developer filter the query
  • Fix widget title filter bug
  • Add Multiple categories
  • Add Multiple tags
  • Add offset & order options
  • Add Read more option
  • Add Default thumbnail
  • Add Thumbnail alignment
  • Add widget title link
  • Add absolute date
  • Add turn on off default styles
Download this release

Release Info

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

Code changes from version 0.7.1 to 0.8

includes/widget-recent-posts-extended.php CHANGED
@@ -1,117 +1,124 @@
1
  <?php
2
-
3
- // Exit if accessed directly
4
- if (!defined('ABSPATH')) exit;
5
-
6
- class rpwe_widget extends WP_Widget
7
- {
8
 
9
  /**
10
  * Widget setup
11
  */
12
- function rpwe_widget()
13
- {
14
 
15
  $widget_ops = array(
16
- 'classname' => 'rpwe_widget recent-posts-extended',
17
- 'description' => __('Advanced recent posts widget.', 'rpwe')
18
  );
19
 
20
  $control_ops = array(
21
- 'width' => 300,
22
- 'height' => 350,
23
- 'id_base' => 'rpwe_widget'
24
  );
25
 
26
- $this->WP_Widget('rpwe_widget', __('&raquo; Recent Posts Widget Extended', 'rpwe'), $widget_ops, $control_ops);
27
 
28
  }
29
 
30
  /**
31
  * Display widget
32
  */
33
- function widget($args, $instance)
34
- {
35
- extract($args, EXTR_SKIP);
36
-
37
- $title = apply_filters('widget_title', $instance['title']);
38
- $cssID = $instance['cssID'];
39
- $cacheLife = (int)($instance['cacheLife']);
40
- $limit = $instance['limit'];
41
- $excerpt = $instance['excerpt'];
42
- $length = (int)($instance['length']);
43
- $thumb = $instance['thumb'];
44
- $thumb_height = (int)($instance['thumb_height']);
45
- $thumb_width = (int)($instance['thumb_width']);
46
- $cat = $instance['cat'];
47
- $post_type = $instance['post_type'];
48
- $date = $instance['date'];
49
- $css = wp_filter_nohtml_kses($instance['css']);
 
 
 
 
 
 
 
 
50
 
51
  echo $before_widget;
52
 
53
- if ($css)
 
 
 
54
  echo '<style>' . $css . '</style>';
55
 
56
- if (!empty($title))
 
 
57
  echo $before_title . $title . $after_title;
58
 
59
  global $post;
60
 
61
- if (false === ($rpwewidget = get_transient('rpwewidget_' . $widget_id))) {
62
-
63
  $args = array(
64
- 'numberposts' => $limit,
65
- 'cat' => $cat,
66
- 'post_type' => $post_type
 
 
 
67
  );
68
 
69
- $rpwewidget = get_posts($args);
 
70
 
71
- //by default, cache for 12 hours
72
- $cachelife = (is_numeric($cacheLife) ? $cacheLife : 43200);
73
-
74
- set_transient('rpwewidget_' . $widget_id, $rpwewidget, $cacheLife);
75
-
76
- } ?>
77
 
78
- <div <?php echo(!empty($cssID) ? 'id="' . $cssID . '"' : ''); ?> class="rpwe-block">
79
 
80
  <ul class="rpwe-ul">
81
 
82
- <?php foreach ($rpwewidget as $post) : setup_postdata($post); ?>
83
 
84
- <li class="rpwe-clearfix">
85
 
86
- <?php if (has_post_thumbnail() && $thumb == true) { ?>
87
 
88
- <a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'rpwe'), the_title_attribute('echo=0')); ?>" rel="bookmark">
89
- <?php
90
- if (current_theme_supports('get-the-image'))
91
- get_the_image(array('meta_key' => 'Thumbnail', 'height' => $thumb_height, 'width' => $thumb_width, 'image_class' => 'rpwe-alignleft', 'link_to_post' => false));
92
- else
93
- the_post_thumbnail(array($thumb_height, $thumb_width), array('class' => 'rpwe-alignleft', 'alt' => esc_attr(get_the_title()), 'title' => esc_attr(get_the_title())));
94
- ?>
95
- </a>
 
 
 
 
96
 
97
  <?php } ?>
98
 
99
  <h3 class="rpwe-title">
100
- <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>
101
  </h3>
102
 
103
- <?php if ($date == true) { ?>
104
- <span class="rpwe-time"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago', 'rpwe'); ?></span>
105
  <?php } ?>
106
 
107
- <?php if ($excerpt == true) { ?>
108
- <div class="rpwe-summary"><?php echo rpwe_excerpt($length); ?></div>
109
  <?php } ?>
110
 
111
  </li>
112
 
113
- <?php endforeach;
114
- wp_reset_postdata(); ?>
115
 
116
  </ul>
117
 
@@ -126,25 +133,31 @@ class rpwe_widget extends WP_Widget
126
  /**
127
  * Update widget
128
  */
129
- function update($new_instance, $old_instance)
130
- {
131
-
132
- $instance = $old_instance;
133
- $instance['title'] = esc_attr($new_instance['title']);
134
- $instance['cssID'] = $new_instance['cssID'];
135
- $instance['cacheLife'] = $new_instance['cacheLife'];
136
- $instance['limit'] = $new_instance['limit'];
137
- $instance['excerpt'] = $new_instance['excerpt'];
138
- $instance['length'] = (int)($new_instance['length']);
139
- $instance['thumb'] = $new_instance['thumb'];
140
- $instance['thumb_height'] = (int)($new_instance['thumb_height']);
141
- $instance['thumb_width'] = (int)($new_instance['thumb_width']);
142
- $instance['cat'] = $new_instance['cat'];
143
- $instance['post_type'] = $new_instance['post_type'];
144
- $instance['date'] = $new_instance['date'];
145
- $instance['css'] = wp_filter_nohtml_kses($new_instance['css']);
146
-
147
- delete_transient('rpwewidget_' . $this->id);
 
 
 
 
 
 
148
 
149
  return $instance;
150
 
@@ -153,110 +166,195 @@ class rpwe_widget extends WP_Widget
153
  /**
154
  * Widget setting
155
  */
156
- function form($instance)
157
- {
 
158
 
159
  /* Set up some default widget settings. */
160
  $defaults = array(
161
- 'title' => '',
162
- 'cssID' => '',
163
- 'cacheLife' => 43200,
164
- 'limit' => 5,
165
- 'excerpt' => '',
166
- 'length' => 10,
167
- 'thumb' => true,
168
- 'thumb_height' => 45,
169
- 'thumb_width' => 45,
170
- 'cat' => '',
171
- 'post_type' => '',
172
- 'date' => true,
173
- 'css' => ''
 
 
 
 
 
 
 
 
 
174
  );
175
 
176
- $instance = wp_parse_args((array)$instance, $defaults);
177
- $title = esc_attr($instance['title']);
178
- $cssID = $instance['cssID'];
179
- $cacheLife = (int)($instance['cacheLife']);
180
- $limit = $instance['limit'];
181
- $excerpt = $instance['excerpt'];
182
- $length = (int)($instance['length']);
183
- $thumb = $instance['thumb'];
184
- $thumb_height = (int)($instance['thumb_height']);
185
- $thumb_width = (int)($instance['thumb_width']);
186
- $cat = $instance['cat'];
187
- $post_type = $instance['post_type'];
188
- $date = $instance['date'];
189
- $css = wp_filter_nohtml_kses($instance['css']);
 
 
 
 
 
 
 
 
 
190
 
191
  ?>
192
 
193
- <p>
194
- <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php _e('Title:', 'rpwe'); ?></label>
195
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo $title; ?>"/>
196
- </p>
197
- <p>
198
- <label for="<?php echo esc_attr($this->get_field_id('cssID')); ?>"><?php _e('Widget CSS ID: (no spaces or special characters)', 'rpwe'); ?></label>
199
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id('cssID')); ?>" name="<?php echo esc_attr($this->get_field_name('cssID')); ?>" type="text" value="<?php echo $cssID; ?>"/>
200
- </p>
201
- <p>
202
- <label for="<?php echo esc_attr($this->get_field_id('cacheLife')); ?>"><?php _e('Cache Life: (in seconds. Default is 43200, 1 to disable)', 'rpwe'); ?></label>
203
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id('cacheLife')); ?>" name="<?php echo esc_attr($this->get_field_name('cacheLife')); ?>" type="text" value="<?php echo $cacheLife; ?>"/>
204
- </p>
205
- <p>
206
- <label for="<?php echo esc_attr($this->get_field_id('limit')); ?>"><?php _e('Limit:', 'rpwe'); ?></label>
207
- <select class="widefat" name="<?php echo $this->get_field_name('limit'); ?>" id="<?php echo $this->get_field_id('limit'); ?>">
208
- <?php for ($i = 1; $i <= 20; $i++) { ?>
209
- <option <?php selected($limit, $i) ?> value="<?php echo $i; ?>"><?php echo $i; ?></option>
210
- <?php } ?>
211
- </select>
212
- </p>
213
- <p>
214
- <label for="<?php echo esc_attr($this->get_field_id('date')); ?>"><?php _e('Display Date?', 'rpwe'); ?></label>
215
- <input id="<?php echo $this->get_field_id('date'); ?>" name="<?php echo $this->get_field_name('date'); ?>" type="checkbox" value="1" <?php checked('1', $date); ?> />&nbsp;
216
- </p>
217
- <p>
218
- <label for="<?php echo esc_attr($this->get_field_id('excerpt')); ?>"><?php _e('Display Excerpt?', 'rpwe'); ?></label>
219
- <input id="<?php echo $this->get_field_id('excerpt'); ?>" name="<?php echo $this->get_field_name('excerpt'); ?>" type="checkbox" value="1" <?php checked('1', $excerpt); ?> />&nbsp;
220
- </p>
221
- <p>
222
- <label for="<?php echo esc_attr($this->get_field_id('length')); ?>"><?php _e('Excerpt Length:', 'rpwe'); ?></label>
223
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id('length')); ?>" name="<?php echo esc_attr($this->get_field_name('length')); ?>" type="text" value="<?php echo $length; ?>"/>
224
- </p>
225
-
226
- <?php if (current_theme_supports('post-thumbnails')) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  <p>
229
- <label for="<?php echo esc_attr($this->get_field_id('thumb')); ?>"><?php _e('Display Thumbnail?', 'rpwe'); ?></label>
230
- <input id="<?php echo $this->get_field_id('thumb'); ?>" name="<?php echo $this->get_field_name('thumb'); ?>" type="checkbox" value="1" <?php checked('1', $thumb); ?> />&nbsp;
231
  </p>
232
  <p>
233
- <label for="<?php echo esc_attr($this->get_field_id('thumb_height')); ?>"><?php _e('Thumbnail Size (height x width):', 'rpwe'); ?></label>
234
- <input id="<?php echo esc_attr($this->get_field_id('thumb_height')); ?>" name="<?php echo esc_attr($this->get_field_name('thumb_height')); ?>" type="text" value="<?php echo $thumb_height; ?>"/>
235
- <input id="<?php echo esc_attr($this->get_field_id('thumb_width')); ?>" name="<?php echo esc_attr($this->get_field_name('thumb_width')); ?>" type="text" value="<?php echo $thumb_width; ?>"/>
236
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
 
238
- <?php } ?>
239
-
240
- <p>
241
- <label for="<?php echo esc_attr($this->get_field_id('cat')); ?>"><?php _e('Limit to Category: ', 'rpwe'); ?></label>
242
- <?php wp_dropdown_categories(array('name' => $this->get_field_name('cat'), 'show_option_all' => __('All categories', 'rpwe'), 'hide_empty' => 1, 'hierarchical' => 1, 'selected' => $cat)); ?>
243
- </p>
244
- <p>
245
- <label for="<?php echo esc_attr($this->get_field_id('post_type')); ?>"><?php _e('Choose the Post Type: ', 'rpwe'); ?></label>
246
- <?php /* pros Justin Tadlock - http://themehybrid.com/ */ ?>
247
- <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?>" name="<?php echo $this->get_field_name('post_type'); ?>">
248
- <?php foreach (get_post_types('', 'objects') as $post_type) { ?>
249
- <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>
250
- <?php } ?>
251
- </select>
252
- </p>
253
- <p>
254
- <label for="<?php echo $this->get_field_id('css'); ?>"><?php _e('Custom CSS:', 'rpwe'); ?></label>
255
- <textarea class="widefat" id="<?php echo $this->get_field_id('css'); ?>" name="<?php echo $this->get_field_name('css'); ?>" style="height:100px;"><?php echo $css; ?></textarea>
256
- </p>
257
- <p>
258
- <span style="color: #f00;">Recent Posts Widget Extended is a project by <a href="http://tokokoo.com" target="_blank">Tokokoo</a></span>
259
- </p>
260
 
261
  <?php
262
  }
@@ -268,12 +366,10 @@ class rpwe_widget extends WP_Widget
268
  *
269
  * @since 0.1
270
  */
271
- function rpwe_register_widget()
272
- {
273
- register_widget('rpwe_widget');
274
  }
275
-
276
- add_action('widgets_init', 'rpwe_register_widget');
277
 
278
  /**
279
  * Print a custom excerpt.
@@ -281,20 +377,31 @@ add_action('widgets_init', 'rpwe_register_widget');
281
  *
282
  * @since 0.1
283
  */
284
- function rpwe_excerpt($length)
285
- {
286
 
287
- $excerpt = explode(' ', get_the_excerpt(), $length);
288
- if (count($excerpt) >= $length) {
289
- array_pop($excerpt);
290
- $excerpt = implode(" ", $excerpt) . '&hellip;';
291
  } else {
292
- $excerpt = implode(" ", $excerpt);
293
  }
294
- $excerpt = preg_replace('`\[[^\]]*\]`', '', $excerpt);
295
 
296
  return $excerpt;
297
 
298
  }
299
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  ?>
1
  <?php
2
+ class rpwe_widget extends WP_Widget {
 
 
 
 
 
3
 
4
  /**
5
  * Widget setup
6
  */
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
 
24
  /**
25
  * Display widget
26
  */
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
 
82
+ <div <?php echo( ! empty( $cssID ) ? 'id="' . $cssID . '"' : '' ); ?> class="rpwe-block">
83
 
84
  <ul class="rpwe-ul">
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
 
121
+ <?php endforeach; wp_reset_postdata(); ?>
 
122
 
123
  </ul>
124
 
133
  /**
134
  * Update 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
 
166
  /**
167
  * Widget setting
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
 
225
+ <div class="rpwe-columns-3">
226
+
227
+ <p>
228
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'rpwe' ); ?></label>
229
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo $title; ?>"/>
230
+ </p>
231
+ <p>
232
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title_url' ) ); ?>"><?php _e( 'Title URL:', 'rpwe' ); ?></label>
233
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title_url' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title_url' ) ); ?>" type="text" value="<?php echo $title_url; ?>"/>
234
+ </p>
235
+ <p>
236
+ <label for="<?php echo esc_attr( $this->get_field_id( 'cssID' ) ); ?>"><?php _e( 'CSS ID:', 'rpwe' ); ?></label>
237
+ <input class="widefat" id="<?php echo esc_attr($this->get_field_id('cssID')); ?>" name="<?php echo esc_attr($this->get_field_name('cssID')); ?>" type="text" value="<?php echo $cssID; ?>"/>
238
+ </p>
239
+ <p>
240
+ <label class="input-checkbox" for="<?php echo esc_attr( $this->get_field_id( 'styles_default' ) ); ?>"><?php _e( 'Use Default Styles', 'rpwe' ); ?></label>
241
+ <input id="<?php echo esc_attr( $this->get_field_id( 'styles_default' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'styles_default' ) ); ?>" type="checkbox" value="1" <?php checked( '1', $styles_default ); ?> />&nbsp;
242
+ </p>
243
+ <p>
244
+ <label for="<?php echo esc_attr( $this->get_field_id( 'css' ) ); ?>"><?php _e( 'CSS:', 'rpwe' ); ?></label>
245
+ <textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'css' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'css' ) ); ?>" style="height:100px;"><?php echo $css; ?></textarea>
246
+ <small><?php _e( 'If you turn off the default styles, please create your own style.', 'rpwe' ); ?></small>
247
+ </p>
248
+
249
+ </div>
250
+
251
+ <div class="rpwe-columns-3">
252
+
253
+ <p>
254
+ <label for="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>"><?php _e( 'Limit:', 'rpwe' ); ?></label>
255
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'limit' ) ); ?>" type="text" value="<?php echo $limit; ?>"/>
256
+ </p>
257
+ <p>
258
+ <label for="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>"><?php _e( 'Offset (the number of posts to skip):', 'rpwe' ); ?></label>
259
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'offset' ) ); ?>" type="text" value="<?php echo $offset; ?>"/>
260
+ </p>
261
+ <p>
262
+ <label for="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>"><?php _e( 'Order:', 'rpwe' ); ?></label>
263
+ <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>" style="width:100%;">
264
+ <option value="DESC" <?php selected( $order, 'DESC' ); ?>><?php _e( 'DESC', 'rpwe' ) ?></option>
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%;">
271
+ <optgroup label="Categories">
272
+ <?php $categories = get_terms( 'category' ); ?>
273
+ <?php foreach( $categories as $category ) { ?>
274
+ <option value="<?php echo $category->term_id; ?>" <?php if ( is_array( $cat ) && in_array( $category->term_id, $cat ) ) echo ' selected="selected"'; ?>><?php echo $category->name; ?></option>
275
+ <?php } ?>
276
+ </optgroup>
277
+ </select>
278
+ </p>
279
+ <p>
280
+ <label for="<?php echo esc_attr( $this->get_field_id( 'tag' ) ); ?>"><?php _e( 'Limit to Tag: ', 'rpwe' ); ?></label>
281
+ <select class="widefat" multiple="multiple" id="<?php echo esc_attr( $this->get_field_id( 'tag' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'tag' ) ); ?>[]" style="width:100%;">
282
+ <optgroup label="Tags">
283
+ <?php $tags = get_terms( 'post_tag' ); ?>
284
+ <?php foreach( $tags as $post_tag ) { ?>
285
+ <option value="<?php echo $post_tag->term_id; ?>" <?php if ( is_array( $tag ) && in_array( $post_tag->term_id, $tag ) ) echo ' selected="selected"'; ?>><?php echo $post_tag->name; ?></option>
286
+ <?php } ?>
287
+ </optgroup>
288
+ </select>
289
+
290
+ </p>
291
+ <p>
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>
299
+ </p>
300
 
301
+ </div>
302
+
303
+ <div class="rpwe-columns-3 rpwe-column-last">
304
+
305
+ <?php if ( current_theme_supports( 'post-thumbnails' ) ) { ?>
306
+
307
+ <p>
308
+ <label class="input-checkbox" for="<?php echo esc_attr( $this->get_field_id( 'thumb' ) ); ?>"><?php _e( 'Display Thumbnail', 'rpwe' ); ?></label>
309
+ <input id="<?php echo esc_attr( $this->get_field_id( 'thumb' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'thumb' ) ); ?>" type="checkbox" value="1" <?php checked( '1', $thumb ); ?> />&nbsp;
310
+ </p>
311
+ <p>
312
+ <label class="rpwe-block" for="<?php echo esc_attr( $this->get_field_id( 'thumb_height' ) ); ?>"><?php _e( 'Thumbnail (height, width, align):', 'rpwe' ); ?></label>
313
+ <input class= "small-input" id="<?php echo esc_attr( $this->get_field_id( 'thumb_height' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'thumb_height' ) ); ?>" type="text" value="<?php echo $thumb_height; ?>"/>
314
+ <input class="small-input" id="<?php echo esc_attr( $this->get_field_id( 'thumb_width' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'thumb_width' ) ); ?>" type="text" value="<?php echo $thumb_width; ?>"/>
315
+ <select class="small-input" id="<?php echo esc_attr( $this->get_field_id( 'thumb_align' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'thumb_align' ) ); ?>">
316
+ <option value="rpwe-alignleft" <?php selected( $thumb_align, 'rpwe-alignleft' ); ?>><?php _e( 'Left', 'rpwe' ) ?></option>
317
+ <option value="rpwe-alignright" <?php selected( $thumb_align, 'rpwe-alignright' ); ?>><?php _e( 'Right', 'rpwe' ) ?></option>
318
+ <option value="rpwe-alignnone" <?php selected( $thumb_align, 'rpwe-alignnone' ); ?>><?php _e( 'Center', 'rpwe' ) ?></option>
319
+ </select>
320
+ </p>
321
+ <p>
322
+ <label for="<?php echo esc_attr( $this->get_field_id( 'thumb_default' ) ); ?>"><?php _e( 'Default Thumbnail:', 'rpwe' ); ?></label>
323
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'thumb_default' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'thumb_default' ) ); ?>" type="text" value="<?php echo $thumb_default; ?>"/>
324
+ <small><?php _e( 'Leave it blank to disable.', 'rpwe' ); ?></small>
325
+ </p>
326
+
327
+ <?php } ?>
328
+
329
+ <p>
330
+ <label class="input-checkbox" for="<?php echo esc_attr( $this->get_field_id( 'excerpt' ) ); ?>"><?php _e( 'Display Excerpt', 'rpwe' ); ?></label>
331
+ <input id="<?php echo esc_attr( $this->get_field_id( 'excerpt' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'excerpt' ) ); ?>" type="checkbox" value="1" <?php checked( '1', $excerpt ); ?> />&nbsp;
332
+ </p>
333
  <p>
334
+ <label for="<?php echo esc_attr( $this->get_field_id( 'length' ) ); ?>"><?php _e( 'Excerpt Length:', 'rpwe' ); ?></label>
335
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'length' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'length' ) ); ?>" type="text" value="<?php echo $length; ?>"/>
336
  </p>
337
  <p>
338
+ <label class="input-checkbox" for="<?php echo esc_attr( $this->get_field_id( 'readmore' ) ); ?>"><?php _e( 'Display Readmore', 'rpwe' ); ?></label>
339
+ <input id="<?php echo esc_attr( $this->get_field_id( 'readmore' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'readmore' ) ); ?>" type="checkbox" value="1" <?php checked( '1', $readmore ); ?> />&nbsp;
 
340
  </p>
341
+ <p>
342
+ <label for="<?php echo esc_attr( $this->get_field_id( 'readmore_text' ) ); ?>"><?php _e( 'Readmore Text:', 'rpwe' ); ?></label>
343
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'readmore_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'readmore_text' ) ); ?>" type="text" value="<?php echo $readmore_text; ?>"/>
344
+ </p>
345
+ <p>
346
+ <label class="input-checkbox" for="<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>"><?php _e( 'Display Date', 'rpwe' ); ?></label>
347
+ <input id="<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'date' ) ); ?>" type="checkbox" value="1" <?php checked( '1', $date ); ?> />&nbsp;
348
+ </p>
349
+ <p>
350
+ <label for="<?php echo esc_attr( $this->get_field_id( 'date_format' ) ); ?>"><?php _e( 'Date Format:', 'rpwe' ); ?></label>
351
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'date_format' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'date_format' ) ); ?>" type="text" value="<?php echo $date_format; ?>"/>
352
+ <small><?php _e( '<a href="http://codex.wordpress.org/Formatting_Date_and_Time" target="_blank">Date reference</a>', 'rpwe' ) ?></small>
353
+ </p>
354
+
355
+ </div>
356
 
357
+ <div class="clear"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
 
359
  <?php
360
  }
366
  *
367
  * @since 0.1
368
  */
369
+ function rpwe_register_widget() {
370
+ register_widget( 'rpwe_widget' );
 
371
  }
372
+ add_action( 'widgets_init', 'rpwe_register_widget' );
 
373
 
374
  /**
375
  * Print a custom excerpt.
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
+ /**
396
+ * Custom Styles.
397
+ *
398
+ * @since 0.8
399
+ */
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
+ }
407
  ?>
languages/rpwe.mo CHANGED
Binary file
languages/rpwe.po CHANGED
@@ -1,87 +1,149 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Recent Posts Widget Extended 0.6\n"
4
- "POT-Creation-Date: 2013-06-15 16:54+0700\n"
5
- "PO-Revision-Date: 2013-06-15 16: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.5\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:17
20
- msgid "Advanced recent posts widget."
21
- msgstr ""
22
-
23
- #: ../includes/widget-recent-posts-extended.php:26
24
- msgid "&raquo; Recent Posts Widget Extended"
25
- msgstr ""
26
-
27
- #: ../includes/widget-recent-posts-extended.php:88
28
- #: ../includes/widget-recent-posts-extended.php:100
29
- #, php-format
30
- msgid "Permalink to %s"
31
- msgstr ""
32
-
33
- #: ../includes/widget-recent-posts-extended.php:104
34
- msgid " ago"
35
- msgstr ""
36
-
37
- #: ../includes/widget-recent-posts-extended.php:194
38
- msgid "Title:"
39
- msgstr ""
40
-
41
- #: ../includes/widget-recent-posts-extended.php:198
42
- msgid "Widget CSS ID: (no spaces or special characters)"
43
- msgstr ""
44
-
45
- #: ../includes/widget-recent-posts-extended.php:202
46
- msgid "Cache Life: (in seconds. Default is 43200, 1 to disable)"
47
- msgstr ""
48
-
49
- #: ../includes/widget-recent-posts-extended.php:206
50
- msgid "Limit:"
51
- msgstr ""
52
-
53
- #: ../includes/widget-recent-posts-extended.php:214
54
- msgid "Display Date?"
55
- msgstr ""
56
-
57
- #: ../includes/widget-recent-posts-extended.php:218
58
- msgid "Display Excerpt?"
59
- msgstr ""
60
-
61
- #: ../includes/widget-recent-posts-extended.php:222
62
- msgid "Excerpt Length:"
63
- msgstr ""
64
-
65
- #: ../includes/widget-recent-posts-extended.php:229
66
- msgid "Display Thumbnail?"
67
- msgstr ""
68
-
69
- #: ../includes/widget-recent-posts-extended.php:233
70
- msgid "Thumbnail Size (height x width):"
71
- msgstr ""
72
-
73
- #: ../includes/widget-recent-posts-extended.php:241
74
- msgid "Limit to Category: "
75
- msgstr ""
76
-
77
- #: ../includes/widget-recent-posts-extended.php:242
78
- msgid "All categories"
79
- msgstr ""
80
-
81
- #: ../includes/widget-recent-posts-extended.php:245
82
- msgid "Choose the Post Type: "
83
- msgstr ""
84
-
85
- #: ../includes/widget-recent-posts-extended.php:254
86
- msgid "Custom CSS:"
87
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>"
149
+ msgstr ""
readme.txt CHANGED
@@ -1,31 +1,37 @@
1
  === Plugin Name ===
2
  Contributors: tokokoo, satrya, davidkryzaniak
3
- Tags: recent posts, thumbnails, widget, widgets, sidebar, excerpt, transient api, multiple widgets
4
- Requires at least: 3.3
5
- Tested up to: 3.5
6
- Stable tag: 0.7.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Provides flexible and advanced recent posts widget. Allows you to display them with thumbnails, post excerpt, specific category and more.
11
 
12
  == Description ==
13
 
14
- This plugin will enable a custom, flexible and advanced recent posts widget. Allows you to display a list of the most recent posts with thumbnail and excerpt, also you can display it from all or a specific category. The recent posts widget extended uses [Transients API](http://codex.wordpress.org/Transients_API) for delivering cached to optimize your site performance when used the widget.
 
 
15
 
16
  = Features Include: =
17
 
18
- * Display thumbnails, with customizable size.
 
19
  * Display excerpt, with customizable length.
20
- * Display from all or a specific category.
21
- * Display post date.
 
 
 
22
  * Post type option.
23
  * Support `get_the_image` function.
24
- * Transients API with cache life timer.
25
  * Multiple widgets.
26
- * Comes pre-styled, but comes proper CSS IDs and Classes to make it match your site.
27
 
28
  = Ugly Image Sizes =
 
29
  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.
30
 
31
  = Support: =
@@ -33,23 +39,48 @@ This plugin creates custom image sizes. If you use images that were uploaded to
33
  2. [Open issue on github](https://github.com/tokokoo/recent-posts-widget-extended/issues).
34
  3. [Rate/Review the plugin](http://wordpress.org/support/view/plugin-reviews/recent-posts-widget-extended).
35
 
36
- = Project Info: =
37
  * Developed by [Tokokoo Team](http://tokokoo.com)
38
  * Follow us on Twitter to keep up with the latest updates [@tokokoo](http://twitter.com/tokokoo)
39
 
 
 
40
  == Installation ==
41
 
42
  1. Upload the 'recent-posts-widget-extended' folder to the `/wp-content/plugins/` directory
43
  2. Activate the plugin through the 'Plugins' menu in WordPress
44
  3. Go to the widgets page.
45
 
 
 
 
 
 
 
46
  == Screenshots ==
 
47
  1. The widget settings
48
 
49
  == Changelog ==
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  = 0.7.1 =
52
- PLEASE RE-SAVE THE WIDGET
53
  * Added setting for cache life
54
  * Added input for CSS class (used for custom styling)
55
  * Fix the inline issue on some themes
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
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ Provides flexible and advanced recent posts widget. Allows you to display them with thumbnails, post excerpt, multiple category and more.
11
 
12
  == Description ==
13
 
14
+ **After updating, please re-save the widget**
15
+
16
+ This plugin will enable a custom, flexible and super advanced recent posts widget. Allows you to display a list of the most recent posts with thumbnail, excerpt and post date, also you can display it from all or specific or multiple category or tag.
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.
24
+ * Display from all, specific or multiple tag.
25
+ * Display post date and you can set the format.
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: =
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 =
67
+ * PLEASE RE-SAVE THE WIDGET
68
+ * Remove caching system, it causing some issues
69
+ * Change Limit option to input text rather than selectbox
70
+ * Add `rpwe_default_query_arguments` filter to allow developer filter the query
71
+ * Fix widget title filter bug
72
+ * Add Multiple categories
73
+ * Add Multiple tags
74
+ * Add offset & order options
75
+ * Add Read more option
76
+ * Add Default thumbnail
77
+ * Add Thumbnail alignment
78
+ * Add widget title link
79
+ * Add absolute date
80
+ * Add turn on off default styles
81
+
82
  = 0.7.1 =
83
+ * PLEASE RE-SAVE THE WIDGET
84
  * Added setting for cache life
85
  * Added input for CSS class (used for custom styling)
86
  * Fix the inline issue on some themes
rpwe.php CHANGED
@@ -3,7 +3,7 @@
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.7.1
7
  Author: Satrya
8
  Author URI: http://tokokoo.com
9
  Author Email: satrya@tokokoo.com
@@ -30,7 +30,7 @@ class RPW_Extended {
30
 
31
  add_action( 'plugins_loaded', array( &$this, 'includes' ), 3 );
32
 
33
- add_action( 'init', array( &$this, 'init' ) );
34
 
35
  }
36
 
@@ -55,10 +55,8 @@ class RPW_Extended {
55
  * @since 0.1
56
  */
57
  public function i18n() {
58
-
59
  /* Load the translation of the plugin. */
60
  load_plugin_textdomain( 'rpwe', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
61
-
62
  }
63
 
64
  /**
@@ -67,23 +65,16 @@ class RPW_Extended {
67
  * @since 0.1
68
  */
69
  public function includes() {
70
-
71
  require_once( RPWE_INCLUDES . 'widget-recent-posts-extended.php' );
72
  }
73
 
74
  /**
75
- * Register custom style for the widget.
76
  *
77
- * @since 0.1
78
  */
79
- function init() {
80
-
81
- if( ! is_admin() ) {
82
-
83
- wp_enqueue_style( 'rpwe-style', RPWE_URI . 'rpwe.css' );
84
-
85
- }
86
-
87
  }
88
 
89
  }
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
7
  Author: Satrya
8
  Author URI: http://tokokoo.com
9
  Author Email: satrya@tokokoo.com
30
 
31
  add_action( 'plugins_loaded', array( &$this, 'includes' ), 3 );
32
 
33
+ add_action( 'admin_enqueue_scripts', array( &$this, 'admin_style' ) );
34
 
35
  }
36
 
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
 
62
  /**
65
  * @since 0.1
66
  */
67
  public function includes() {
 
68
  require_once( RPWE_INCLUDES . 'widget-recent-posts-extended.php' );
69
  }
70
 
71
  /**
72
+ * Register custom style for the widget settings.
73
  *
74
+ * @since 0.8
75
  */
76
+ function admin_style() {
77
+ wp_enqueue_style( 'rpwe-admin-style', RPWE_URI . 'includes/admin.css' );
 
 
 
 
 
 
78
  }
79
 
80
  }
screenshot-1.png CHANGED
Binary file