Version Description
- 8/31/2014 =
- I'm sorry for long wait the bug fixes update. I'm back to support and maintenance this plugin again :)
- Added:
strip_shortcodes()
to prevent shorcodes showing in the post excert, Pros jeffreyvr. It should fixed issue excerpt not displaying - Added: French translation, Pros rwatuny french translation
- Added: Option to set
suppress_filters
true or false. - Fixed: Arguments in
the_post_thumbnail()
, it should width as first item and height as second.
Download this release
Release Info
Developer | satrya |
Plugin | Recent Posts Widget Extended |
Version | 0.9.3 |
Comparing to | |
See all releases |
Code changes from version 0.9.2 to 0.9.3
- includes/widget-recent-posts-extended.php +174 -136
- readme.txt +31 -26
- rpwe.php +12 -24
includes/widget-recent-posts-extended.php
CHANGED
@@ -101,8 +101,7 @@ class Recent_Posts_Widget_Extended extends WP_Widget {
|
|
101 |
'offset' => $offset,
|
102 |
'order' => $order,
|
103 |
'orderby' => $orderby,
|
104 |
-
|
105 |
-
'suppress_filters' => false
|
106 |
);
|
107 |
|
108 |
/* Allow developer to filter the query. */
|
@@ -133,11 +132,10 @@ class Recent_Posts_Widget_Extended extends WP_Widget {
|
|
133 |
|
134 |
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute('echo=0' ) ); ?>" rel="bookmark">
|
135 |
<?php the_post_thumbnail(
|
136 |
-
array( $
|
137 |
array(
|
138 |
'class' => $thumb_align . ' rpwe-thumb the-post-thumbnail',
|
139 |
-
'alt' => esc_attr( get_the_title() )
|
140 |
-
'title' => esc_attr( get_the_title() )
|
141 |
)
|
142 |
); ?>
|
143 |
</a>
|
@@ -207,29 +205,30 @@ class Recent_Posts_Widget_Extended extends WP_Widget {
|
|
207 |
*/
|
208 |
function update( $new_instance, $old_instance ) {
|
209 |
|
210 |
-
$instance
|
211 |
-
$instance['title']
|
212 |
-
$instance['title_url']
|
213 |
-
$instance['cssID']
|
214 |
-
$instance['limit']
|
215 |
-
$instance['offset']
|
216 |
-
$instance['order']
|
217 |
-
$instance['orderby']
|
218 |
-
$instance['excerpt']
|
219 |
-
$instance['length']
|
220 |
-
$instance['thumb']
|
221 |
-
$instance['thumb_height']
|
222 |
-
$instance['thumb_width']
|
223 |
-
$instance['thumb_default']
|
224 |
-
$instance['thumb_align']
|
225 |
-
$instance['cat']
|
226 |
-
$instance['tag']
|
227 |
-
$instance['post_type']
|
228 |
-
$instance['date']
|
229 |
-
$instance['readmore']
|
230 |
-
$instance['readmore_text']
|
231 |
-
$instance['styles_default']
|
232 |
-
$instance['css']
|
|
|
233 |
|
234 |
return $instance;
|
235 |
|
@@ -247,139 +246,158 @@ class Recent_Posts_Widget_Extended extends WP_Widget {
|
|
247 |
|
248 |
/* Set up some default widget settings. */
|
249 |
$defaults = array(
|
250 |
-
'title'
|
251 |
-
'title_url'
|
252 |
-
'cssID'
|
253 |
-
'limit'
|
254 |
-
'offset'
|
255 |
-
'order'
|
256 |
-
'orderby'
|
257 |
-
'excerpt'
|
258 |
-
'length'
|
259 |
-
'thumb'
|
260 |
-
'thumb_height'
|
261 |
-
'thumb_width'
|
262 |
-
'thumb_default'
|
263 |
-
'thumb_align'
|
264 |
-
'cat'
|
265 |
-
'tag'
|
266 |
-
'post_type'
|
267 |
-
'date'
|
268 |
-
'readmore'
|
269 |
-
'readmore_text'
|
270 |
-
'styles_default'
|
271 |
-
'css'
|
|
|
272 |
);
|
273 |
|
274 |
-
$instance
|
275 |
-
$title = strip_tags( $instance['title'] );
|
276 |
-
$title_url = esc_url( $instance['title_url'] );
|
277 |
-
$cssID = sanitize_html_class( $instance['cssID'] );
|
278 |
-
$limit = (int)( $instance['limit'] );
|
279 |
-
$offset = (int)( $instance['offset'] );
|
280 |
-
$order = $instance['order'];
|
281 |
-
$orderby = $instance['orderby'];
|
282 |
-
$excerpt = $instance['excerpt'];
|
283 |
-
$length = (int)($instance['length']);
|
284 |
-
$thumb = $instance['thumb'];
|
285 |
-
$thumb_height = (int)( $instance['thumb_height'] );
|
286 |
-
$thumb_width = (int)( $instance['thumb_width'] );
|
287 |
-
$thumb_default = $instance['thumb_default'];
|
288 |
-
$thumb_align = $instance['thumb_align'];
|
289 |
-
$cat = $instance['cat'];
|
290 |
-
$tag = $instance['tag'];
|
291 |
-
$post_type = $instance['post_type'];
|
292 |
-
$date = $instance['date'];
|
293 |
-
$readmore = $instance['readmore'];
|
294 |
-
$readmore_text = strip_tags( $instance['readmore_text'] );
|
295 |
-
$styles_default = $instance['styles_default'];
|
296 |
-
$css = wp_filter_nohtml_kses( $instance['css'] );
|
297 |
-
|
298 |
?>
|
299 |
|
300 |
<div class="rpwe-columns-3">
|
301 |
|
302 |
<p>
|
303 |
-
<label for="<?php echo
|
304 |
-
|
|
|
|
|
305 |
</p>
|
|
|
306 |
<p>
|
307 |
-
<label for="<?php echo
|
308 |
-
|
|
|
|
|
309 |
</p>
|
|
|
310 |
<p>
|
311 |
-
<label for="<?php echo
|
312 |
-
|
|
|
|
|
313 |
</p>
|
|
|
314 |
<p>
|
315 |
-
<label class="input-checkbox" for="<?php echo
|
316 |
-
|
|
|
|
|
317 |
</p>
|
|
|
318 |
<p>
|
319 |
-
<label for="<?php echo
|
320 |
-
|
|
|
|
|
321 |
<small><?php _e( 'If you turn off the default styles, please create your own style.', 'rpwe' ); ?></small>
|
322 |
</p>
|
323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
</div>
|
325 |
|
326 |
<div class="rpwe-columns-3">
|
327 |
|
328 |
<p>
|
329 |
-
<label for="<?php echo
|
330 |
-
|
|
|
|
|
331 |
</p>
|
|
|
332 |
<p>
|
333 |
-
<label for="<?php echo
|
334 |
-
|
|
|
|
|
335 |
</p>
|
|
|
336 |
<p>
|
337 |
-
<label for="<?php echo
|
338 |
-
|
339 |
-
|
340 |
-
|
|
|
|
|
341 |
</select>
|
342 |
</p>
|
|
|
343 |
<p>
|
344 |
-
<label for="<?php echo
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
<option value="
|
349 |
-
<option value="
|
350 |
-
<option value="
|
351 |
-
<option value="
|
352 |
-
<option value="
|
353 |
-
<option value="
|
|
|
|
|
354 |
</select>
|
355 |
</p>
|
|
|
356 |
<p>
|
357 |
-
<label for="<?php echo
|
358 |
-
|
|
|
|
|
359 |
<optgroup label="Categories">
|
360 |
<?php $categories = get_terms( 'category' ); ?>
|
361 |
<?php foreach( $categories as $category ) { ?>
|
362 |
-
<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>
|
363 |
<?php } ?>
|
364 |
</optgroup>
|
365 |
</select>
|
366 |
</p>
|
|
|
367 |
<p>
|
368 |
-
<label for="<?php echo
|
369 |
-
|
|
|
|
|
370 |
<optgroup label="Tags">
|
371 |
<?php $tags = get_terms( 'post_tag' ); ?>
|
372 |
<?php foreach( $tags as $post_tag ) { ?>
|
373 |
-
<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>
|
374 |
<?php } ?>
|
375 |
</optgroup>
|
376 |
</select>
|
377 |
-
|
378 |
</p>
|
|
|
379 |
<p>
|
380 |
-
<label for="<?php echo
|
|
|
|
|
381 |
<?php /* pros Justin Tadlock - http://themehybrid.com/ */ ?>
|
382 |
-
<select class="widefat" id="<?php echo
|
383 |
<?php foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $post_type ) { ?>
|
384 |
<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>
|
385 |
<?php } ?>
|
@@ -393,46 +411,68 @@ class Recent_Posts_Widget_Extended extends WP_Widget {
|
|
393 |
<?php if ( current_theme_supports( 'post-thumbnails' ) ) { ?>
|
394 |
|
395 |
<p>
|
396 |
-
<label class="input-checkbox" for="<?php echo
|
397 |
-
|
|
|
|
|
398 |
</p>
|
|
|
399 |
<p>
|
400 |
-
<label class="rpwe-block" for="<?php echo
|
401 |
-
|
402 |
-
|
403 |
-
<
|
404 |
-
|
405 |
-
|
406 |
-
<option value="rpwe-
|
|
|
|
|
407 |
</select>
|
408 |
</p>
|
|
|
409 |
<p>
|
410 |
-
<label for="<?php echo
|
411 |
-
|
|
|
|
|
412 |
<small><?php _e( 'Leave it blank to disable.', 'rpwe' ); ?></small>
|
413 |
</p>
|
414 |
|
415 |
<?php } ?>
|
416 |
|
417 |
<p>
|
418 |
-
<label class="input-checkbox" for="<?php echo
|
419 |
-
|
|
|
|
|
420 |
</p>
|
|
|
421 |
<p>
|
422 |
-
<label for="<?php echo
|
423 |
-
|
|
|
|
|
424 |
</p>
|
|
|
425 |
<p>
|
426 |
-
<label class="input-checkbox" for="<?php echo
|
427 |
-
|
|
|
|
|
428 |
</p>
|
|
|
429 |
<p>
|
430 |
-
<label for="<?php echo
|
431 |
-
|
|
|
|
|
432 |
</p>
|
|
|
433 |
<p>
|
434 |
-
<label class="input-checkbox" for="<?php echo
|
435 |
-
|
|
|
|
|
436 |
</p>
|
437 |
|
438 |
</div>
|
@@ -450,13 +490,11 @@ class Recent_Posts_Widget_Extended extends WP_Widget {
|
|
450 |
*
|
451 |
* @param integer $length
|
452 |
* @since 0.1
|
453 |
-
* @version 0.9
|
454 |
-
* @access public
|
455 |
* @return string
|
456 |
* @link http://codex.wordpress.org/Function_Reference/wp_trim_words
|
457 |
*/
|
458 |
function rpwe_excerpt( $length ) {
|
459 |
-
$content = get_the_content();
|
460 |
$excerpt = wp_trim_words( $content, $length );
|
461 |
|
462 |
return $excerpt;
|
@@ -474,4 +512,4 @@ function rpwe_custom_styles() {
|
|
474 |
.rpwe-block ul{list-style:none!important;margin-left:0!important;padding-left:0!important;}.rpwe-block li{border-bottom:1px solid #eee;margin-bottom:10px;padding-bottom:10px;list-style-type: none;}.rpwe-block a{display:inline!important;text-decoration:none;}.rpwe-block h3{background:none!important;clear:none;margin-bottom:0!important;margin-top:0!important;font-weight:400;font-size:12px!important;line-height:1.5em;}.rpwe-thumb{border:1px solid #EEE!important;box-shadow:none!important;margin:2px 10px 2px 0;padding:3px!important;}.rpwe-summary{font-size:12px;}.rpwe-time{color:#bbb;font-size:11px;}.rpwe-alignleft{display:inline;float:left;}.rpwe-alignright{display:inline;float:right;}.rpwe-alignnone{display:block;float:none;}.rpwe-clearfix:before,.rpwe-clearfix:after{content:"";display:table !important;}.rpwe-clearfix:after{clear:both;}.rpwe-clearfix{zoom:1;}
|
475 |
</style>
|
476 |
<?php
|
477 |
-
}
|
101 |
'offset' => $offset,
|
102 |
'order' => $order,
|
103 |
'orderby' => $orderby,
|
104 |
+
'suppress_filters' => $instance['suppress_filters']
|
|
|
105 |
);
|
106 |
|
107 |
/* Allow developer to filter the query. */
|
132 |
|
133 |
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute('echo=0' ) ); ?>" rel="bookmark">
|
134 |
<?php the_post_thumbnail(
|
135 |
+
array( $thumb_width, $thumb_height, true ),
|
136 |
array(
|
137 |
'class' => $thumb_align . ' rpwe-thumb the-post-thumbnail',
|
138 |
+
'alt' => esc_attr( get_the_title() )
|
|
|
139 |
)
|
140 |
); ?>
|
141 |
</a>
|
205 |
*/
|
206 |
function update( $new_instance, $old_instance ) {
|
207 |
|
208 |
+
$instance = $old_instance;
|
209 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
210 |
+
$instance['title_url'] = esc_url_raw( $new_instance['title_url'] );
|
211 |
+
$instance['cssID'] = sanitize_html_class( $new_instance['cssID'] );
|
212 |
+
$instance['limit'] = (int)( $new_instance['limit'] );
|
213 |
+
$instance['offset'] = (int)( $new_instance['offset'] );
|
214 |
+
$instance['order'] = $new_instance['order'];
|
215 |
+
$instance['orderby'] = $new_instance['orderby'];
|
216 |
+
$instance['excerpt'] = $new_instance['excerpt'];
|
217 |
+
$instance['length'] = (int)( $new_instance['length'] );
|
218 |
+
$instance['thumb'] = $new_instance['thumb'];
|
219 |
+
$instance['thumb_height'] = (int)( $new_instance['thumb_height'] );
|
220 |
+
$instance['thumb_width'] = (int)( $new_instance['thumb_width'] );
|
221 |
+
$instance['thumb_default'] = esc_url_raw( $new_instance['thumb_default'] );
|
222 |
+
$instance['thumb_align'] = $new_instance['thumb_align'];
|
223 |
+
$instance['cat'] = $new_instance['cat'];
|
224 |
+
$instance['tag'] = $new_instance['tag'];
|
225 |
+
$instance['post_type'] = $new_instance['post_type'];
|
226 |
+
$instance['date'] = $new_instance['date'];
|
227 |
+
$instance['readmore'] = $new_instance['readmore'];
|
228 |
+
$instance['readmore_text'] = strip_tags( $new_instance['readmore_text'] );
|
229 |
+
$instance['styles_default'] = $new_instance['styles_default'];
|
230 |
+
$instance['css'] = wp_filter_nohtml_kses( $new_instance['css'] );
|
231 |
+
$instance['suppress_filters'] = $new_instance['suppress_filters'];
|
232 |
|
233 |
return $instance;
|
234 |
|
246 |
|
247 |
/* Set up some default widget settings. */
|
248 |
$defaults = array(
|
249 |
+
'title' => '',
|
250 |
+
'title_url' => '',
|
251 |
+
'cssID' => '',
|
252 |
+
'limit' => 5,
|
253 |
+
'offset' => 0,
|
254 |
+
'order' => 'DESC',
|
255 |
+
'orderby' => 'date',
|
256 |
+
'excerpt' => false,
|
257 |
+
'length' => 10,
|
258 |
+
'thumb' => true,
|
259 |
+
'thumb_height' => 45,
|
260 |
+
'thumb_width' => 45,
|
261 |
+
'thumb_default' => 'http://placehold.it/45x45/f0f0f0/ccc',
|
262 |
+
'thumb_align' => 'rpwe-alignleft',
|
263 |
+
'cat' => '',
|
264 |
+
'tag' => '',
|
265 |
+
'post_type' => '',
|
266 |
+
'date' => true,
|
267 |
+
'readmore' => false,
|
268 |
+
'readmore_text' => __( 'Read More »', 'rpwe' ),
|
269 |
+
'styles_default' => true,
|
270 |
+
'css' => $css_defaults,
|
271 |
+
'suppress_filters' => false
|
272 |
);
|
273 |
|
274 |
+
$instance = wp_parse_args( (array)$instance, $defaults );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
?>
|
276 |
|
277 |
<div class="rpwe-columns-3">
|
278 |
|
279 |
<p>
|
280 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>">
|
281 |
+
<?php _e( 'Title:', 'rpwe' ); ?>
|
282 |
+
</label>
|
283 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
|
284 |
</p>
|
285 |
+
|
286 |
<p>
|
287 |
+
<label for="<?php echo $this->get_field_id( 'title_url' ); ?>">
|
288 |
+
<?php _e( 'Title URL:', 'rpwe' ); ?>
|
289 |
+
</label>
|
290 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title_url' ); ?>" name="<?php echo $this->get_field_name( 'title_url' ); ?>" type="text" value="<?php echo esc_url( $instance['title_url'] ); ?>" />
|
291 |
</p>
|
292 |
+
|
293 |
<p>
|
294 |
+
<label for="<?php echo $this->get_field_id( 'cssID' ); ?>">
|
295 |
+
<?php _e( 'CSS ID:', 'rpwe' ); ?>
|
296 |
+
</label>
|
297 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'cssID' ); ?>" name="<?php echo $this->get_field_name( 'cssID' ); ?>" type="text" value="<?php echo sanitize_html_class( $instance['cssID'] ); ?>"/>
|
298 |
</p>
|
299 |
+
|
300 |
<p>
|
301 |
+
<label class="input-checkbox" for="<?php echo $this->get_field_id( 'styles_default' ); ?>">
|
302 |
+
<?php _e( 'Use Default Styles', 'rpwe' ); ?>
|
303 |
+
</label>
|
304 |
+
<input id="<?php echo $this->get_field_id( 'styles_default' ); ?>" name="<?php echo $this->get_field_name( 'styles_default' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['styles_default'] ); ?> />
|
305 |
</p>
|
306 |
+
|
307 |
<p>
|
308 |
+
<label for="<?php echo $this->get_field_id( 'css' ); ?>">
|
309 |
+
<?php _e( 'CSS:', 'rpwe' ); ?>
|
310 |
+
</label>
|
311 |
+
<textarea class="widefat" id="<?php echo $this->get_field_id( 'css' ); ?>" name="<?php echo $this->get_field_name( 'css' ); ?>" style="height:100px;"><?php echo wp_filter_nohtml_kses( $instance['css'] ); ?></textarea>
|
312 |
<small><?php _e( 'If you turn off the default styles, please create your own style.', 'rpwe' ); ?></small>
|
313 |
</p>
|
314 |
|
315 |
+
<p>
|
316 |
+
<label class="input-checkbox" for="<?php echo $this->get_field_id( 'suppress_filters' ); ?>">
|
317 |
+
<?php _e( 'Suppress Filters', 'rpwe' ); ?>
|
318 |
+
</label>
|
319 |
+
<input id="<?php echo $this->get_field_id( 'suppress_filters' ); ?>" name="<?php echo $this->get_field_name( 'suppress_filters' ); ?>" type="checkbox" value="false" <?php checked( 'false', $instance['suppress_filters'] ); ?> /> <br />
|
320 |
+
<small><?php _e( 'Check to set to True', 'rpwe' ); ?></small>
|
321 |
+
</p>
|
322 |
+
|
323 |
</div>
|
324 |
|
325 |
<div class="rpwe-columns-3">
|
326 |
|
327 |
<p>
|
328 |
+
<label for="<?php echo $this->get_field_id( 'limit' ); ?>">
|
329 |
+
<?php _e( 'Limit:', 'rpwe' ); ?>
|
330 |
+
</label>
|
331 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo (int)( $instance['limit'] ); ?>" />
|
332 |
</p>
|
333 |
+
|
334 |
<p>
|
335 |
+
<label for="<?php echo $this->get_field_id( 'offset' ); ?>">
|
336 |
+
<?php _e( 'Offset (the number of posts to skip):', 'rpwe' ); ?>
|
337 |
+
</label>
|
338 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'offset' ); ?>" name="<?php echo $this->get_field_name( 'offset' ); ?>" type="text" value="<?php echo (int)( $instance['offset'] ); ?>" />
|
339 |
</p>
|
340 |
+
|
341 |
<p>
|
342 |
+
<label for="<?php echo $this->get_field_id( 'order' ); ?>">
|
343 |
+
<?php _e( 'Order:', 'rpwe' ); ?>
|
344 |
+
</label>
|
345 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'order' ); ?>" name="<?php echo $this->get_field_name( 'order' ); ?>" style="width:100%;">
|
346 |
+
<option value="DESC" <?php selected( $instance['order'], 'DESC' ); ?>><?php _e( 'Descending', 'rpwe' ) ?></option>
|
347 |
+
<option value="ASC" <?php selected( $instance['order'], 'ASC' ); ?>><?php _e( 'Ascending', 'rpwe' ) ?></option>
|
348 |
</select>
|
349 |
</p>
|
350 |
+
|
351 |
<p>
|
352 |
+
<label for="<?php echo $this->get_field_id( 'orderby' ); ?>">
|
353 |
+
<?php _e( 'Orderby:', 'rpwe' ); ?>
|
354 |
+
</label>
|
355 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'orderby' ); ?>" name="<?php echo $this->get_field_name( 'orderby' ); ?>" style="width:100%;">
|
356 |
+
<option value="ID" <?php selected( $instance['orderby'], 'ID' ); ?>><?php _e( 'ID', 'rpwe' ) ?></option>
|
357 |
+
<option value="author" <?php selected( $instance['orderby'], 'author' ); ?>><?php _e( 'Author', 'rpwe' ) ?></option>
|
358 |
+
<option value="title" <?php selected( $instance['orderby'], 'title' ); ?>><?php _e( 'Title', 'rpwe' ) ?></option>
|
359 |
+
<option value="date" <?php selected( $instance['orderby'], 'date' ); ?>><?php _e( 'Date', 'rpwe' ) ?></option>
|
360 |
+
<option value="modified" <?php selected( $instance['orderby'], 'modified' ); ?>><?php _e( 'Modified', 'rpwe' ) ?></option>
|
361 |
+
<option value="rand" <?php selected( $instance['orderby'], 'rand' ); ?>><?php _e( 'Random', 'rpwe' ) ?></option>
|
362 |
+
<option value="comment_count" <?php selected( $instance['orderby'], 'comment_count' ); ?>><?php _e( 'Comment Count', 'rpwe' ) ?></option>
|
363 |
+
<option value="menu_order" <?php selected( $instance['orderby'], 'menu_order' ); ?>><?php _e( 'Menu Order', 'rpwe' ) ?></option>
|
364 |
</select>
|
365 |
</p>
|
366 |
+
|
367 |
<p>
|
368 |
+
<label for="<?php echo $this->get_field_id( 'cat' ); ?>">
|
369 |
+
<?php _e( 'Limit to Category: ', 'rpwe' ); ?>
|
370 |
+
</label>
|
371 |
+
<select class="widefat" multiple="multiple" id="<?php echo $this->get_field_id( 'cat' ); ?>" name="<?php echo $this->get_field_name( 'cat' ); ?>[]" style="width:100%;">
|
372 |
<optgroup label="Categories">
|
373 |
<?php $categories = get_terms( 'category' ); ?>
|
374 |
<?php foreach( $categories as $category ) { ?>
|
375 |
+
<option value="<?php echo $category->term_id; ?>" <?php if ( is_array( $instance['cat'] ) && in_array( $category->term_id, $instance['cat'] ) ) echo ' selected="selected"'; ?>><?php echo $category->name; ?></option>
|
376 |
<?php } ?>
|
377 |
</optgroup>
|
378 |
</select>
|
379 |
</p>
|
380 |
+
|
381 |
<p>
|
382 |
+
<label for="<?php echo $this->get_field_id( 'tag' ); ?>">
|
383 |
+
<?php _e( 'Limit to Tag: ', 'rpwe' ); ?>
|
384 |
+
</label>
|
385 |
+
<select class="widefat" multiple="multiple" id="<?php echo $this->get_field_id( 'tag' ); ?>" name="<?php echo $this->get_field_name( 'tag' ); ?>[]" style="width:100%;">
|
386 |
<optgroup label="Tags">
|
387 |
<?php $tags = get_terms( 'post_tag' ); ?>
|
388 |
<?php foreach( $tags as $post_tag ) { ?>
|
389 |
+
<option value="<?php echo $post_tag->term_id; ?>" <?php if ( is_array( $instance['tag'] ) && in_array( $post_tag->term_id, $instance['tag'] ) ) echo ' selected="selected"'; ?>><?php echo $post_tag->name; ?></option>
|
390 |
<?php } ?>
|
391 |
</optgroup>
|
392 |
</select>
|
|
|
393 |
</p>
|
394 |
+
|
395 |
<p>
|
396 |
+
<label for="<?php echo $this->get_field_id( 'post_type' ); ?>">
|
397 |
+
<?php _e( 'Post Type: ', 'rpwe' ); ?>
|
398 |
+
</label>
|
399 |
<?php /* pros Justin Tadlock - http://themehybrid.com/ */ ?>
|
400 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'post_type' ); ?>" name="<?php echo $this->get_field_name( 'post_type' ); ?>">
|
401 |
<?php foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $post_type ) { ?>
|
402 |
<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>
|
403 |
<?php } ?>
|
411 |
<?php if ( current_theme_supports( 'post-thumbnails' ) ) { ?>
|
412 |
|
413 |
<p>
|
414 |
+
<label class="input-checkbox" for="<?php echo $this->get_field_id( 'thumb' ); ?>">
|
415 |
+
<?php _e( 'Display Thumbnail', 'rpwe' ); ?>
|
416 |
+
</label>
|
417 |
+
<input id="<?php echo $this->get_field_id( 'thumb' ); ?>" name="<?php echo $this->get_field_name( 'thumb' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['thumb'] ); ?> />
|
418 |
</p>
|
419 |
+
|
420 |
<p>
|
421 |
+
<label class="rpwe-block" for="<?php echo $this->get_field_id( 'thumb_height' ); ?>">
|
422 |
+
<?php _e( 'Thumbnail (height, width, align):', 'rpwe' ); ?>
|
423 |
+
</label>
|
424 |
+
<input class= "small-input" id="<?php echo $this->get_field_id( 'thumb_height' ); ?>" name="<?php echo $this->get_field_name( 'thumb_height' ); ?>" type="text" value="<?php echo (int)( $instance['thumb_height'] ); ?>" />
|
425 |
+
<input class="small-input" id="<?php echo $this->get_field_id( 'thumb_width' ); ?>" name="<?php echo $this->get_field_name( 'thumb_width' ); ?>" type="text" value="<?php echo (int)( $instance['thumb_width'] ); ?>"/>
|
426 |
+
<select class="small-input" id="<?php echo $this->get_field_id( 'thumb_align' ); ?>" name="<?php echo $this->get_field_name( 'thumb_align' ); ?>">
|
427 |
+
<option value="rpwe-alignleft" <?php selected( $instance['thumb_align'], 'rpwe-alignleft' ); ?>><?php _e( 'Left', 'rpwe' ) ?></option>
|
428 |
+
<option value="rpwe-alignright" <?php selected( $instance['thumb_align'], 'rpwe-alignright' ); ?>><?php _e( 'Right', 'rpwe' ) ?></option>
|
429 |
+
<option value="rpwe-alignnone" <?php selected( $instance['thumb_align'], 'rpwe-alignnone' ); ?>><?php _e( 'Center', 'rpwe' ) ?></option>
|
430 |
</select>
|
431 |
</p>
|
432 |
+
|
433 |
<p>
|
434 |
+
<label for="<?php echo $this->get_field_id( 'thumb_default' ); ?>">
|
435 |
+
<?php _e( 'Default Thumbnail:', 'rpwe' ); ?>
|
436 |
+
</label>
|
437 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'thumb_default' ); ?>" name="<?php echo $this->get_field_name( 'thumb_default' ); ?>" type="text" value="<?php echo $instance['thumb_default']; ?>"/>
|
438 |
<small><?php _e( 'Leave it blank to disable.', 'rpwe' ); ?></small>
|
439 |
</p>
|
440 |
|
441 |
<?php } ?>
|
442 |
|
443 |
<p>
|
444 |
+
<label class="input-checkbox" for="<?php echo $this->get_field_id( 'excerpt' ); ?>">
|
445 |
+
<?php _e( 'Display Excerpt', 'rpwe' ); ?>
|
446 |
+
</label>
|
447 |
+
<input id="<?php echo $this->get_field_id( 'excerpt' ); ?>" name="<?php echo $this->get_field_name( 'excerpt' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['excerpt'] ); ?> />
|
448 |
</p>
|
449 |
+
|
450 |
<p>
|
451 |
+
<label for="<?php echo $this->get_field_id( 'length' ); ?>">
|
452 |
+
<?php _e( 'Excerpt Length:', 'rpwe' ); ?>
|
453 |
+
</label>
|
454 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'length' ); ?>" name="<?php echo $this->get_field_name( 'length' ); ?>" type="text" value="<?php echo (int)( $instance['length'] ); ?>" />
|
455 |
</p>
|
456 |
+
|
457 |
<p>
|
458 |
+
<label class="input-checkbox" for="<?php echo $this->get_field_id( 'readmore' ); ?>">
|
459 |
+
<?php _e( 'Display Readmore', 'rpwe' ); ?>
|
460 |
+
</label>
|
461 |
+
<input id="<?php echo $this->get_field_id( 'readmore' ); ?>" name="<?php echo $this->get_field_name( 'readmore' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['readmore'] ); ?> />
|
462 |
</p>
|
463 |
+
|
464 |
<p>
|
465 |
+
<label for="<?php echo $this->get_field_id( 'readmore_text' ); ?>">
|
466 |
+
<?php _e( 'Readmore Text:', 'rpwe' ); ?>
|
467 |
+
</label>
|
468 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'readmore_text' ); ?>" name="<?php echo $this->get_field_name( 'readmore_text' ); ?>" type="text" value="<?php echo strip_tags( $instance['readmore_text'] ); ?>" />
|
469 |
</p>
|
470 |
+
|
471 |
<p>
|
472 |
+
<label class="input-checkbox" for="<?php echo $this->get_field_id( 'date' ); ?>">
|
473 |
+
<?php _e( 'Display Date', 'rpwe' ); ?>
|
474 |
+
</label>
|
475 |
+
<input id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['date'] ); ?> />
|
476 |
</p>
|
477 |
|
478 |
</div>
|
490 |
*
|
491 |
* @param integer $length
|
492 |
* @since 0.1
|
|
|
|
|
493 |
* @return string
|
494 |
* @link http://codex.wordpress.org/Function_Reference/wp_trim_words
|
495 |
*/
|
496 |
function rpwe_excerpt( $length ) {
|
497 |
+
$content = strip_shortcodes( get_the_content() ); // Strip shortcodes from content.
|
498 |
$excerpt = wp_trim_words( $content, $length );
|
499 |
|
500 |
return $excerpt;
|
512 |
.rpwe-block ul{list-style:none!important;margin-left:0!important;padding-left:0!important;}.rpwe-block li{border-bottom:1px solid #eee;margin-bottom:10px;padding-bottom:10px;list-style-type: none;}.rpwe-block a{display:inline!important;text-decoration:none;}.rpwe-block h3{background:none!important;clear:none;margin-bottom:0!important;margin-top:0!important;font-weight:400;font-size:12px!important;line-height:1.5em;}.rpwe-thumb{border:1px solid #EEE!important;box-shadow:none!important;margin:2px 10px 2px 0;padding:3px!important;}.rpwe-summary{font-size:12px;}.rpwe-time{color:#bbb;font-size:11px;}.rpwe-alignleft{display:inline;float:left;}.rpwe-alignright{display:inline;float:right;}.rpwe-alignnone{display:block;float:none;}.rpwe-clearfix:before,.rpwe-clearfix:after{content:"";display:table !important;}.rpwe-clearfix:after{clear:both;}.rpwe-clearfix{zoom:1;}
|
513 |
</style>
|
514 |
<?php
|
515 |
+
}
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
===
|
2 |
-
Contributors: satrya, themejunkie
|
3 |
Donate link: http://satrya.me/donate/
|
4 |
Tags: recent posts, random posts, thumbnails, widget, widgets, sidebar, excerpt, category, post tag, post type, multiple widgets
|
5 |
Requires at least: 3.6
|
6 |
-
Tested up to: 3.9
|
7 |
-
Stable tag: 0.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -12,26 +12,13 @@ Provides flexible and advanced recent posts widget. Allows you to display them w
|
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
**Version 1.0.0 Coming Soon**
|
16 |
-
Version 1.0.0 is the first major update for the plugin. It will comes with more cool features such as:
|
17 |
-
|
18 |
-
* More clean code
|
19 |
-
* Shortcodes
|
20 |
-
* Fix the thumbnail size issue
|
21 |
-
* Pagination support
|
22 |
-
* Taxonomy support
|
23 |
-
* Display post author
|
24 |
-
* Display post taxonomy
|
25 |
-
* Masonry layout (*experiment*)
|
26 |
-
* And much more!
|
27 |
-
|
28 |
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.
|
29 |
|
30 |
= Features Include: =
|
31 |
|
32 |
-
* WordPress 3.9 Support.
|
33 |
-
*
|
34 |
-
*
|
35 |
* Display thumbnails, with customizable size and alignment.
|
36 |
* Display excerpt, with customizable length.
|
37 |
* Display from all, specific or multiple category.
|
@@ -67,8 +54,9 @@ This plugin creates custom image sizes. If you use images that were uploaded to
|
|
67 |
* Developed by [Satrya](http://satrya.me/) & [Theme Junkie](http://www.theme-junkie.com/)
|
68 |
* Check out the [Github](https://github.com/satrya/recent-posts-widget-extended) repo to contribute.
|
69 |
|
70 |
-
=
|
71 |
-
|
|
|
72 |
|
73 |
== Installation ==
|
74 |
|
@@ -93,20 +81,37 @@ If you want to buy me a cup of coffee, you can do by visiting [this page](http:/
|
|
93 |
|
94 |
== Frequently Asked Questions ==
|
95 |
|
96 |
-
= How to filter the query
|
97 |
-
You can use `rpwe_default_query_arguments` filter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
= Thumbnail size option not working properly =
|
100 |
Yes, this is because the plugin uses `the_post_thumbnail` custom sizes and not uses `add_image_size` function, [more information](http://codex.wordpress.org/Function_Reference/the_post_thumbnail). At the moment I have no idea how to fix this issue.
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
== Screenshots ==
|
103 |
|
104 |
1. The widget settings
|
105 |
|
106 |
== Changelog ==
|
107 |
|
108 |
-
=
|
109 |
-
*
|
|
|
|
|
|
|
|
|
110 |
|
111 |
= 0.9.2 - 5/20/2014 =
|
112 |
* Fix missing stylesheet in the admin area.
|
1 |
+
=== Recent Posts Widget Extended ===
|
2 |
+
Contributors: satrya, themejunkie
|
3 |
Donate link: http://satrya.me/donate/
|
4 |
Tags: recent posts, random posts, thumbnails, widget, widgets, sidebar, excerpt, category, post tag, post type, multiple widgets
|
5 |
Requires at least: 3.6
|
6 |
+
Tested up to: 3.9.2
|
7 |
+
Stable tag: 0.9.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
12 |
|
13 |
== Description ==
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
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.
|
16 |
|
17 |
= Features Include: =
|
18 |
|
19 |
+
* WordPress 3.9.2 Support.
|
20 |
+
* Set the title url.
|
21 |
+
* Display by date, comment count or random.
|
22 |
* Display thumbnails, with customizable size and alignment.
|
23 |
* Display excerpt, with customizable length.
|
24 |
* Display from all, specific or multiple category.
|
54 |
* Developed by [Satrya](http://satrya.me/) & [Theme Junkie](http://www.theme-junkie.com/)
|
55 |
* Check out the [Github](https://github.com/satrya/recent-posts-widget-extended) repo to contribute.
|
56 |
|
57 |
+
= Contributors =
|
58 |
+
* [David Kryzaniak](http://profiles.wordpress.org/davidkryzaniak/)
|
59 |
+
* [AKbyte](http://profiles.wordpress.org/akbyte/)
|
60 |
|
61 |
== Installation ==
|
62 |
|
81 |
|
82 |
== Frequently Asked Questions ==
|
83 |
|
84 |
+
= How to filter the post query? =
|
85 |
+
You can use `rpwe_default_query_arguments` to filter it.
|
86 |
+
`
|
87 |
+
add_filter( 'rpwe_default_query_arguments', 'your_custom_function' );
|
88 |
+
function your_custom_function( $args ) {
|
89 |
+
$args['posts_per_page'] = 10; // Changing the number of posts to show.
|
90 |
+
return $args;
|
91 |
+
}
|
92 |
+
`
|
93 |
|
94 |
= Thumbnail size option not working properly =
|
95 |
Yes, this is because the plugin uses `the_post_thumbnail` custom sizes and not uses `add_image_size` function, [more information](http://codex.wordpress.org/Function_Reference/the_post_thumbnail). At the moment I have no idea how to fix this issue.
|
96 |
|
97 |
+
= Ordering not working! =
|
98 |
+
Did you installed any Post or Post Type Order? Please try to deactivate it and try again the ordering. [(related question)](http://wordpress.org/support/topic/ordering-set-to-descending-not-working)
|
99 |
+
|
100 |
+
= No image options =
|
101 |
+
Your theme needs to support Post Thumbnail, please go to http://codex.wordpress.org/Post_Thumbnails to read more info and how to activate it in your theme.
|
102 |
+
|
103 |
== Screenshots ==
|
104 |
|
105 |
1. The widget settings
|
106 |
|
107 |
== Changelog ==
|
108 |
|
109 |
+
= 0.9.3 - 8/31/2014 =
|
110 |
+
* I'm sorry for long wait the bug fixes update. I'm back to support and maintenance this plugin again :)
|
111 |
+
* Added: `strip_shortcodes()` to prevent shorcodes showing in the post excert, Pros [jeffreyvr](http://www.web-on.nl/). It should fixed issue [excerpt not displaying](http://wordpress.org/support/topic/excerpts-not-displaying-1)
|
112 |
+
* Added: French translation, Pros rwatuny [french translation](http://wordpress.org/support/topic/plugin-recent-posts-widget-extended-french-translation)
|
113 |
+
* Added: Option to set `suppress_filters` true or false.
|
114 |
+
* Fixed: Arguments in `the_post_thumbnail()`, it should width as first item and height as second.
|
115 |
|
116 |
= 0.9.2 - 5/20/2014 =
|
117 |
* Fix missing stylesheet in the admin area.
|
rpwe.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Recent Posts Widget Extended
|
4 |
* Plugin URI: http://satrya.me/wordpress-plugins/recent-posts-widget-extended/
|
5 |
* Description: Enables advanced widget that gives you total control over the output of your site’s most recent Posts.
|
6 |
-
* Version: 0.9.
|
7 |
* Author: Satrya
|
8 |
* Author URI: http://satrya.me/
|
9 |
* Author Email: satrya@satrya.me
|
@@ -34,24 +34,22 @@ class RPW_Extended {
|
|
34 |
* PHP5 constructor method.
|
35 |
*
|
36 |
* @since 0.1
|
37 |
-
* @access public
|
38 |
-
* @return void
|
39 |
*/
|
40 |
public function __construct() {
|
41 |
|
42 |
-
|
43 |
add_action( 'plugins_loaded', array( &$this, 'constants' ), 1 );
|
44 |
|
45 |
-
|
46 |
add_action( 'plugins_loaded', array( &$this, 'i18n' ), 2 );
|
47 |
|
48 |
-
|
49 |
add_action( 'plugins_loaded', array( &$this, 'includes' ), 3 );
|
50 |
|
51 |
-
|
52 |
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_style' ) );
|
53 |
|
54 |
-
|
55 |
add_action( 'widgets_init', array( &$this, 'register_widget' ) );
|
56 |
|
57 |
}
|
@@ -60,21 +58,19 @@ class RPW_Extended {
|
|
60 |
* Defines constants used by the plugin.
|
61 |
*
|
62 |
* @since 0.1
|
63 |
-
* @access public
|
64 |
-
* @return void
|
65 |
*/
|
66 |
public function constants() {
|
67 |
|
68 |
-
|
69 |
define( 'RPWE_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
|
70 |
|
71 |
-
|
72 |
define( 'RPWE_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );
|
73 |
|
74 |
-
|
75 |
define( 'RPWE_INCLUDES', RPWE_DIR . trailingslashit( 'includes' ) );
|
76 |
|
77 |
-
|
78 |
define( 'RPWE_ASSETS', RPWE_URI . trailingslashit( 'assets' ) );
|
79 |
|
80 |
}
|
@@ -83,8 +79,6 @@ class RPW_Extended {
|
|
83 |
* Loads the translation files.
|
84 |
*
|
85 |
* @since 0.1
|
86 |
-
* @access public
|
87 |
-
* @return void
|
88 |
*/
|
89 |
public function i18n() {
|
90 |
load_plugin_textdomain( 'rpwe', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
@@ -94,8 +88,6 @@ class RPW_Extended {
|
|
94 |
* Loads the initial files needed by the plugin.
|
95 |
*
|
96 |
* @since 0.1
|
97 |
-
* @access public
|
98 |
-
* @return void
|
99 |
*/
|
100 |
public function includes() {
|
101 |
require_once( RPWE_INCLUDES . 'widget-recent-posts-extended.php' );
|
@@ -105,16 +97,14 @@ class RPW_Extended {
|
|
105 |
* Register custom style for the widget settings.
|
106 |
*
|
107 |
* @since 0.8
|
108 |
-
* @access public
|
109 |
-
* @return void
|
110 |
*/
|
111 |
public function admin_style() {
|
112 |
|
113 |
-
|
114 |
if ( 'widgets' != get_current_screen()->base )
|
115 |
return;
|
116 |
|
117 |
-
|
118 |
wp_enqueue_style( 'rpwe-admin-style', trailingslashit( RPWE_ASSETS ) . 'css/rpwe-admin.css', null, null );
|
119 |
|
120 |
}
|
@@ -123,8 +113,6 @@ class RPW_Extended {
|
|
123 |
* Register the widget.
|
124 |
*
|
125 |
* @since 0.9.1
|
126 |
-
* @access public
|
127 |
-
* @return void
|
128 |
*/
|
129 |
public function register_widget() {
|
130 |
register_widget( 'Recent_Posts_Widget_Extended' );
|
3 |
* Plugin Name: Recent Posts Widget Extended
|
4 |
* Plugin URI: http://satrya.me/wordpress-plugins/recent-posts-widget-extended/
|
5 |
* Description: Enables advanced widget that gives you total control over the output of your site’s most recent Posts.
|
6 |
+
* Version: 0.9.3
|
7 |
* Author: Satrya
|
8 |
* Author URI: http://satrya.me/
|
9 |
* Author Email: satrya@satrya.me
|
34 |
* PHP5 constructor method.
|
35 |
*
|
36 |
* @since 0.1
|
|
|
|
|
37 |
*/
|
38 |
public function __construct() {
|
39 |
|
40 |
+
// Set the constants needed by the plugin.
|
41 |
add_action( 'plugins_loaded', array( &$this, 'constants' ), 1 );
|
42 |
|
43 |
+
// Internationalize the text strings used.
|
44 |
add_action( 'plugins_loaded', array( &$this, 'i18n' ), 2 );
|
45 |
|
46 |
+
// Load the functions files.
|
47 |
add_action( 'plugins_loaded', array( &$this, 'includes' ), 3 );
|
48 |
|
49 |
+
// Load the admin style.
|
50 |
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_style' ) );
|
51 |
|
52 |
+
// Register widget.
|
53 |
add_action( 'widgets_init', array( &$this, 'register_widget' ) );
|
54 |
|
55 |
}
|
58 |
* Defines constants used by the plugin.
|
59 |
*
|
60 |
* @since 0.1
|
|
|
|
|
61 |
*/
|
62 |
public function constants() {
|
63 |
|
64 |
+
// Set constant path to the plugin directory.
|
65 |
define( 'RPWE_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
|
66 |
|
67 |
+
// Set the constant path to the plugin directory URI.
|
68 |
define( 'RPWE_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );
|
69 |
|
70 |
+
// Set the constant path to the includes directory.
|
71 |
define( 'RPWE_INCLUDES', RPWE_DIR . trailingslashit( 'includes' ) );
|
72 |
|
73 |
+
// Set the constant path to the assets directory.
|
74 |
define( 'RPWE_ASSETS', RPWE_URI . trailingslashit( 'assets' ) );
|
75 |
|
76 |
}
|
79 |
* Loads the translation files.
|
80 |
*
|
81 |
* @since 0.1
|
|
|
|
|
82 |
*/
|
83 |
public function i18n() {
|
84 |
load_plugin_textdomain( 'rpwe', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
88 |
* Loads the initial files needed by the plugin.
|
89 |
*
|
90 |
* @since 0.1
|
|
|
|
|
91 |
*/
|
92 |
public function includes() {
|
93 |
require_once( RPWE_INCLUDES . 'widget-recent-posts-extended.php' );
|
97 |
* Register custom style for the widget settings.
|
98 |
*
|
99 |
* @since 0.8
|
|
|
|
|
100 |
*/
|
101 |
public function admin_style() {
|
102 |
|
103 |
+
// Check if current screen is Widgets page.
|
104 |
if ( 'widgets' != get_current_screen()->base )
|
105 |
return;
|
106 |
|
107 |
+
// Loads the widget style.
|
108 |
wp_enqueue_style( 'rpwe-admin-style', trailingslashit( RPWE_ASSETS ) . 'css/rpwe-admin.css', null, null );
|
109 |
|
110 |
}
|
113 |
* Register the widget.
|
114 |
*
|
115 |
* @since 0.9.1
|
|
|
|
|
116 |
*/
|
117 |
public function register_widget() {
|
118 |
register_widget( 'Recent_Posts_Widget_Extended' );
|