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 | 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 +293 -186
- languages/rpwe.mo +0 -0
- languages/rpwe.po +149 -87
- readme.txt +44 -13
- rpwe.php +6 -15
- screenshot-1.png +0 -0
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
|
13 |
-
{
|
14 |
|
15 |
$widget_ops = array(
|
16 |
-
'classname'
|
17 |
-
'description'
|
18 |
);
|
19 |
|
20 |
$control_ops = array(
|
21 |
-
'width'
|
22 |
-
'height'
|
23 |
-
'id_base'
|
24 |
);
|
25 |
|
26 |
-
|
27 |
|
28 |
}
|
29 |
|
30 |
/**
|
31 |
* Display widget
|
32 |
*/
|
33 |
-
function widget($args, $instance)
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
$
|
38 |
-
$cssID
|
39 |
-
$
|
40 |
-
$
|
41 |
-
$
|
42 |
-
$
|
43 |
-
$
|
44 |
-
$
|
45 |
-
$
|
46 |
-
$
|
47 |
-
$
|
48 |
-
$
|
49 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
echo $before_widget;
|
52 |
|
53 |
-
if ($
|
|
|
|
|
|
|
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'
|
65 |
-
'
|
66 |
-
'
|
|
|
|
|
|
|
67 |
);
|
68 |
|
69 |
-
$
|
|
|
70 |
|
71 |
-
|
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 (
|
87 |
|
88 |
-
|
89 |
-
<?php
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
|
|
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 |
-
<
|
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
|
133 |
-
$instance['
|
134 |
-
$instance['cssID']
|
135 |
-
$instance['
|
136 |
-
$instance['
|
137 |
-
$instance['
|
138 |
-
$instance['
|
139 |
-
$instance['
|
140 |
-
$instance['
|
141 |
-
$instance['
|
142 |
-
$instance['
|
143 |
-
$instance['
|
144 |
-
$instance['
|
145 |
-
$instance['
|
146 |
-
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
'
|
163 |
-
'
|
164 |
-
'limit'
|
165 |
-
'
|
166 |
-
'
|
167 |
-
'
|
168 |
-
'
|
169 |
-
'
|
170 |
-
'
|
171 |
-
'
|
172 |
-
'
|
173 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
);
|
175 |
|
176 |
-
$instance
|
177 |
-
$title
|
178 |
-
$
|
179 |
-
$
|
180 |
-
$limit
|
181 |
-
$
|
182 |
-
$
|
183 |
-
$
|
184 |
-
$
|
185 |
-
$
|
186 |
-
$
|
187 |
-
$
|
188 |
-
$
|
189 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
?>
|
192 |
|
193 |
-
<
|
194 |
-
|
195 |
-
<
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
<
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
<
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
<
|
208 |
-
<?php
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
<p>
|
229 |
-
<label for="<?php echo esc_attr($this->get_field_id('
|
230 |
-
<input id="<?php echo $this->get_field_id('
|
231 |
</p>
|
232 |
<p>
|
233 |
-
<label for="<?php echo esc_attr($this->get_field_id('
|
234 |
-
<input id="<?php echo esc_attr($this->get_field_id('
|
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 |
-
|
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)
|
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', __( '» 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 »', '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 ); ?> />
|
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 ); ?> />
|
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 ); ?> />
|
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 ); ?> />
|
|
|
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 ); ?> />
|
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-
|
5 |
-
"PO-Revision-Date: 2013-
|
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.
|
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:
|
20 |
-
msgid "Advanced recent posts widget."
|
21 |
-
msgstr ""
|
22 |
-
|
23 |
-
#: ../includes/widget-recent-posts-extended.php:
|
24 |
-
msgid "» Recent Posts Widget Extended"
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: ../includes/widget-recent-posts-extended.php:
|
28 |
-
#: ../includes/widget-recent-posts-extended.php:
|
29 |
-
#, php-format
|
30 |
-
msgid "Permalink to %s"
|
31 |
-
msgstr ""
|
32 |
-
|
33 |
-
#: ../includes/widget-recent-posts-extended.php:
|
34 |
-
msgid "
|
35 |
-
msgstr ""
|
36 |
-
|
37 |
-
#: ../includes/widget-recent-posts-extended.php:
|
38 |
-
msgid "Title:"
|
39 |
-
msgstr ""
|
40 |
-
|
41 |
-
#: ../includes/widget-recent-posts-extended.php:
|
42 |
-
msgid "
|
43 |
-
msgstr ""
|
44 |
-
|
45 |
-
#: ../includes/widget-recent-posts-extended.php:
|
46 |
-
msgid "
|
47 |
-
msgstr ""
|
48 |
-
|
49 |
-
#: ../includes/widget-recent-posts-extended.php:
|
50 |
-
msgid "
|
51 |
-
msgstr ""
|
52 |
-
|
53 |
-
#: ../includes/widget-recent-posts-extended.php:
|
54 |
-
msgid "
|
55 |
-
msgstr ""
|
56 |
-
|
57 |
-
#: ../includes/widget-recent-posts-extended.php:
|
58 |
-
msgid "
|
59 |
-
msgstr ""
|
60 |
-
|
61 |
-
#: ../includes/widget-recent-posts-extended.php:
|
62 |
-
msgid "
|
63 |
-
msgstr ""
|
64 |
-
|
65 |
-
#: ../includes/widget-recent-posts-extended.php:
|
66 |
-
msgid "
|
67 |
-
msgstr ""
|
68 |
-
|
69 |
-
#: ../includes/widget-recent-posts-extended.php:
|
70 |
-
msgid "
|
71 |
-
msgstr ""
|
72 |
-
|
73 |
-
#: ../includes/widget-recent-posts-extended.php:
|
74 |
-
msgid "
|
75 |
-
msgstr ""
|
76 |
-
|
77 |
-
#: ../includes/widget-recent-posts-extended.php:
|
78 |
-
msgid "
|
79 |
-
msgstr ""
|
80 |
-
|
81 |
-
#: ../includes/widget-recent-posts-extended.php:
|
82 |
-
msgid "
|
83 |
-
msgstr ""
|
84 |
-
|
85 |
-
#: ../includes/widget-recent-posts-extended.php:
|
86 |
-
msgid "
|
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 "» 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 »"
|
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,
|
4 |
-
Requires at least: 3.
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 0.
|
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,
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
|
|
|
|
|
15 |
|
16 |
= Features Include: =
|
17 |
|
18 |
-
*
|
|
|
19 |
* Display excerpt, with customizable length.
|
20 |
-
* Display from all or
|
21 |
-
* Display
|
|
|
|
|
|
|
22 |
* Post type option.
|
23 |
* Support `get_the_image` function.
|
24 |
-
*
|
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 |
-
=
|
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 |
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( '
|
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.
|
78 |
*/
|
79 |
-
function
|
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
|