Recent Posts Widget Extended - Version 0.7

Version Description

  • Remove a tag when no thumbnail
  • Add custom css box
  • Inheritance font-family
  • Update language
Download this release

Release Info

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

Code changes from version 0.6 to 0.7

includes/widget-recent-posts-extended.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  // Exit if accessed directly
4
- if ( !defined('ABSPATH') ) exit;
5
 
6
  class rpwe_widget extends WP_Widget {
7
 
@@ -11,7 +11,7 @@ class rpwe_widget extends WP_Widget {
11
  function rpwe_widget() {
12
 
13
  $widget_ops = array(
14
- 'classname' => 'rpwe_widget',
15
  'description' => __( 'Advanced recent posts widget.', 'rpwe' )
16
  );
17
 
@@ -41,10 +41,14 @@ class rpwe_widget extends WP_Widget {
41
  $cat = $instance['cat'];
42
  $post_type = $instance['post_type'];
43
  $date = $instance['date'];
 
44
 
45
  echo $before_widget;
 
 
 
46
 
47
- if (!empty( $title ))
48
  echo $before_title . $title . $after_title;
49
 
50
  global $post;
@@ -70,21 +74,19 @@ class rpwe_widget extends WP_Widget {
70
  <?php foreach( $rpwewidget as $post ) : setup_postdata( $post ); ?>
71
 
72
  <li class="rpwe-clearfix">
73
-
74
- <a href="<?php esc_url( the_permalink() ); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
75
-
76
- <?php
77
- if( $thumb == true ) {
78
 
 
 
 
 
79
  if ( current_theme_supports( 'get-the-image' ) )
80
- get_the_image( array( 'meta_key' => 'Thumbnail', 'height' => $thumb_height, 'width' => $thumb_width, 'image_class' => 'rpwe-alignleft' ) );
81
  else
82
  the_post_thumbnail( array( $thumb_height, $thumb_width ), array( 'class' => 'rpwe-alignleft', 'alt' => esc_attr( get_the_title() ), 'title' => esc_attr( get_the_title() ) ) );
 
 
83
 
84
- }
85
- ?>
86
-
87
- </a>
88
 
89
  <h3 class="rpwe-title">
90
  <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>
@@ -128,6 +130,7 @@ class rpwe_widget extends WP_Widget {
128
  $instance['cat'] = $new_instance['cat'];
129
  $instance['post_type'] = $new_instance['post_type'];
130
  $instance['date'] = $new_instance['date'];
 
131
 
132
  delete_transient( 'rpwewidget_' . $this->id );
133
 
@@ -151,7 +154,8 @@ class rpwe_widget extends WP_Widget {
151
  'thumb_width' => 45,
152
  'cat' => '',
153
  'post_type' => '',
154
- 'date' => true
 
155
  );
156
 
157
  $instance = wp_parse_args( (array) $instance, $defaults );
@@ -165,6 +169,7 @@ class rpwe_widget extends WP_Widget {
165
  $cat = $instance['cat'];
166
  $post_type = $instance['post_type'];
167
  $date = $instance['date'];
 
168
 
169
  ?>
170
 
@@ -220,6 +225,10 @@ class rpwe_widget extends WP_Widget {
220
  <?php } ?>
221
  </select>
222
  </p>
 
 
 
 
223
  <p>
224
  <span style="color: #f00;">Recent Posts Widget Extended is a project by <a href="http://tokokoo.com" target="_blank">Tokokoo</a></span>
225
  </p>
@@ -234,12 +243,10 @@ class rpwe_widget extends WP_Widget {
234
  *
235
  * @since 0.1
236
  */
237
- add_action( 'widgets_init', 'rpwe_register_widget' );
238
  function rpwe_register_widget() {
239
-
240
  register_widget( 'rpwe_widget' );
241
-
242
  }
 
243
 
244
  /**
245
  * Print a custom excerpt.
@@ -261,5 +268,4 @@ function rpwe_excerpt( $length ) {
261
  return $excerpt;
262
 
263
  }
264
-
265
  ?>
1
  <?php
2
 
3
  // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) exit;
5
 
6
  class rpwe_widget extends WP_Widget {
7
 
11
  function rpwe_widget() {
12
 
13
  $widget_ops = array(
14
+ 'classname' => 'rpwe_widget recent-posts-extended',
15
  'description' => __( 'Advanced recent posts widget.', 'rpwe' )
16
  );
17
 
41
  $cat = $instance['cat'];
42
  $post_type = $instance['post_type'];
43
  $date = $instance['date'];
44
+ $css = wp_filter_nohtml_kses( $instance['css'] );
45
 
46
  echo $before_widget;
47
+
48
+ if( $css )
49
+ echo '<style>' . $css . '</style>';
50
 
51
+ if ( ! empty( $title ) )
52
  echo $before_title . $title . $after_title;
53
 
54
  global $post;
74
  <?php foreach( $rpwewidget as $post ) : setup_postdata( $post ); ?>
75
 
76
  <li class="rpwe-clearfix">
 
 
 
 
 
77
 
78
+ <?php if( has_post_thumbnail() && $thumb == true ) { ?>
79
+
80
+ <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
81
+ <?php
82
  if ( current_theme_supports( 'get-the-image' ) )
83
+ get_the_image( array( 'meta_key' => 'Thumbnail', 'height' => $thumb_height, 'width' => $thumb_width, 'image_class' => 'rpwe-alignleft', 'link_to_post' => false ) );
84
  else
85
  the_post_thumbnail( array( $thumb_height, $thumb_width ), array( 'class' => 'rpwe-alignleft', 'alt' => esc_attr( get_the_title() ), 'title' => esc_attr( get_the_title() ) ) );
86
+ ?>
87
+ </a>
88
 
89
+ <?php } ?>
 
 
 
90
 
91
  <h3 class="rpwe-title">
92
  <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>
130
  $instance['cat'] = $new_instance['cat'];
131
  $instance['post_type'] = $new_instance['post_type'];
132
  $instance['date'] = $new_instance['date'];
133
+ $instance['css'] = wp_filter_nohtml_kses( $new_instance['css'] );
134
 
135
  delete_transient( 'rpwewidget_' . $this->id );
136
 
154
  'thumb_width' => 45,
155
  'cat' => '',
156
  'post_type' => '',
157
+ 'date' => true,
158
+ 'css' => ''
159
  );
160
 
161
  $instance = wp_parse_args( (array) $instance, $defaults );
169
  $cat = $instance['cat'];
170
  $post_type = $instance['post_type'];
171
  $date = $instance['date'];
172
+ $css = wp_filter_nohtml_kses( $instance['css'] );
173
 
174
  ?>
175
 
225
  <?php } ?>
226
  </select>
227
  </p>
228
+ <p>
229
+ <label for="<?php echo $this->get_field_id( 'css' ); ?>"><?php _e( 'Custom CSS:', 'rpwe' ); ?></label>
230
+ <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>
231
+ </p>
232
  <p>
233
  <span style="color: #f00;">Recent Posts Widget Extended is a project by <a href="http://tokokoo.com" target="_blank">Tokokoo</a></span>
234
  </p>
243
  *
244
  * @since 0.1
245
  */
 
246
  function rpwe_register_widget() {
 
247
  register_widget( 'rpwe_widget' );
 
248
  }
249
+ add_action( 'widgets_init', 'rpwe_register_widget' );
250
 
251
  /**
252
  * Print a custom excerpt.
268
  return $excerpt;
269
 
270
  }
 
271
  ?>
languages/rpwe.mo CHANGED
Binary file
languages/rpwe.po CHANGED
@@ -1,15 +1,15 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Recent Posts Widget Extended 0.6\n"
4
- "POT-Creation-Date: 2013-02-04 21:40+0700\n"
5
- "PO-Revision-Date: 2013-02-04 21:40+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.4\n"
13
  "X-Poedit-KeywordsList: __;_e;esc_attr__\n"
14
  "X-Poedit-Basepath: .\n"
15
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
@@ -24,52 +24,56 @@ msgstr ""
24
  msgid "&raquo; Recent Posts Widget Extended"
25
  msgstr ""
26
 
27
- #: ../includes/widget-recent-posts-extended.php:74
28
- #: ../includes/widget-recent-posts-extended.php:90
29
  #, php-format
30
  msgid "Permalink to %s"
31
  msgstr ""
32
 
33
- #: ../includes/widget-recent-posts-extended.php:94
34
  msgid " ago"
35
  msgstr ""
36
 
37
- #: ../includes/widget-recent-posts-extended.php:172
38
  msgid "Title:"
39
  msgstr ""
40
 
41
- #: ../includes/widget-recent-posts-extended.php:176
42
  msgid "Limit:"
43
  msgstr ""
44
 
45
- #: ../includes/widget-recent-posts-extended.php:184
46
  msgid "Display date?"
47
  msgstr ""
48
 
49
- #: ../includes/widget-recent-posts-extended.php:188
50
  msgid "Display excerpt?"
51
  msgstr ""
52
 
53
- #: ../includes/widget-recent-posts-extended.php:192
54
  msgid "Excerpt length:"
55
  msgstr ""
56
 
57
- #: ../includes/widget-recent-posts-extended.php:199
58
  msgid "Display thumbnail?"
59
  msgstr ""
60
 
61
- #: ../includes/widget-recent-posts-extended.php:203
62
  msgid "Thumbnail size (height x width):"
63
  msgstr ""
64
 
65
- #: ../includes/widget-recent-posts-extended.php:211
66
  msgid "Limit to category: "
67
  msgstr ""
68
 
69
- #: ../includes/widget-recent-posts-extended.php:212
70
  msgid "All categories"
71
  msgstr ""
72
 
73
- #: ../includes/widget-recent-posts-extended.php:215
74
  msgid "Choose the Post Type: "
75
  msgstr ""
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Recent Posts Widget Extended 0.6\n"
4
+ "POT-Creation-Date: 2013-04-02 02:37+0700\n"
5
+ "PO-Revision-Date: 2013-04-02 02:37+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"
24
  msgid "&raquo; Recent Posts Widget Extended"
25
  msgstr ""
26
 
27
+ #: ../includes/widget-recent-posts-extended.php:80
28
+ #: ../includes/widget-recent-posts-extended.php:92
29
  #, php-format
30
  msgid "Permalink to %s"
31
  msgstr ""
32
 
33
+ #: ../includes/widget-recent-posts-extended.php:96
34
  msgid " ago"
35
  msgstr ""
36
 
37
+ #: ../includes/widget-recent-posts-extended.php:177
38
  msgid "Title:"
39
  msgstr ""
40
 
41
+ #: ../includes/widget-recent-posts-extended.php:181
42
  msgid "Limit:"
43
  msgstr ""
44
 
45
+ #: ../includes/widget-recent-posts-extended.php:189
46
  msgid "Display date?"
47
  msgstr ""
48
 
49
+ #: ../includes/widget-recent-posts-extended.php:193
50
  msgid "Display excerpt?"
51
  msgstr ""
52
 
53
+ #: ../includes/widget-recent-posts-extended.php:197
54
  msgid "Excerpt length:"
55
  msgstr ""
56
 
57
+ #: ../includes/widget-recent-posts-extended.php:204
58
  msgid "Display thumbnail?"
59
  msgstr ""
60
 
61
+ #: ../includes/widget-recent-posts-extended.php:208
62
  msgid "Thumbnail size (height x width):"
63
  msgstr ""
64
 
65
+ #: ../includes/widget-recent-posts-extended.php:216
66
  msgid "Limit to category: "
67
  msgstr ""
68
 
69
+ #: ../includes/widget-recent-posts-extended.php:217
70
  msgid "All categories"
71
  msgstr ""
72
 
73
+ #: ../includes/widget-recent-posts-extended.php:220
74
  msgid "Choose the Post Type: "
75
  msgstr ""
76
+
77
+ #: ../includes/widget-recent-posts-extended.php:229
78
+ msgid "Custom CSS:"
79
+ msgstr ""
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: tokokoo, satrya
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.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -20,7 +20,7 @@ This plugin will enable a custom, fleksible and advanced recent posts widget. Al
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.
25
  * Multiple widgets.
26
 
@@ -47,6 +47,12 @@ This plugin creates custom image sizes. If you use images that were uploaded to
47
 
48
  == Changelog ==
49
 
 
 
 
 
 
 
50
  = 0.6 =
51
  * Update language
52
  * Reset the loop
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
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
20
  * Display from all or a specific category.
21
  * Display post date.
22
  * Post type option.
23
+ * Support [Get The Image](http://wordpress.org/extend/plugins/get-the-image/) plugin.
24
  * Transients API.
25
  * Multiple widgets.
26
 
47
 
48
  == Changelog ==
49
 
50
+ = 0.7 =
51
+ * Remove `a` tag when no thumbnail
52
+ * Add custom css box
53
+ * Inheritance `font-family`
54
+ * Update language
55
+
56
  = 0.6 =
57
  * Update language
58
  * Reset the loop
rpwe.css CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
  Description: Custom CSS for the Recent Posts Widget Extended.
3
  Version: 0.1
4
- Revision: 0.5
5
  Author: Satrya
6
  License: GPLv2
7
  */
@@ -28,7 +28,6 @@ License: GPLv2
28
  margin-bottom: 0 !important;
29
  font-weight: normal;
30
  font-size: 12px !important;
31
- font-family: Arial, sans-serif;
32
  line-height: 1.5em;
33
  }
34
 
@@ -42,14 +41,12 @@ License: GPLv2
42
  }
43
 
44
  .rpwe-summary {
45
- font-family: Arial, sans-serif;
46
  font-size: 12px;
47
  }
48
 
49
  .rpwe-time {
50
  color: #bbb;
51
  font-size: 11px;
52
- font-family: Arial, sans-serif;
53
  }
54
 
55
  .rpwe-clearfix:before,
1
  /*
2
  Description: Custom CSS for the Recent Posts Widget Extended.
3
  Version: 0.1
4
+ Revision: 0.7
5
  Author: Satrya
6
  License: GPLv2
7
  */
28
  margin-bottom: 0 !important;
29
  font-weight: normal;
30
  font-size: 12px !important;
 
31
  line-height: 1.5em;
32
  }
33
 
41
  }
42
 
43
  .rpwe-summary {
 
44
  font-size: 12px;
45
  }
46
 
47
  .rpwe-time {
48
  color: #bbb;
49
  font-size: 11px;
 
50
  }
51
 
52
  .rpwe-clearfix:before,
rpwe.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Recent Posts Widget Extended
4
  Plugin URI: http://wordpress.org/extend/plugins/recent-posts-widget-extended/
5
  Description: Enables recent posts widget with advanced settings.
6
- Version: 0.6
7
  Author: Satrya
8
  Author URI: http://tokokoo.com
9
  Author Email: satrya@tokokoo.com
@@ -89,6 +89,5 @@ class RPW_Extended {
89
  }
90
 
91
  new RPW_Extended;
92
-
93
  endif;
94
  ?>
3
  Plugin Name: Recent Posts Widget Extended
4
  Plugin URI: http://wordpress.org/extend/plugins/recent-posts-widget-extended/
5
  Description: Enables recent posts widget with advanced settings.
6
+ Version: 0.7
7
  Author: Satrya
8
  Author URI: http://tokokoo.com
9
  Author Email: satrya@tokokoo.com
89
  }
90
 
91
  new RPW_Extended;
 
92
  endif;
93
  ?>