Recent Posts Widget Extended - Version 0.4

Version Description

  • Add date option
  • Support get_the_image function
  • Re-arrange markup
  • Update language
Download this release

Release Info

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

Code changes from version 0.3 to 0.4

includes/widget-recent-posts-extended.php CHANGED
@@ -39,7 +39,8 @@ class rpwe_widget extends WP_Widget {
39
  $thumb_height = (int)( $instance['thumb_height'] );
40
  $thumb_width = (int)( $instance['thumb_width'] );
41
  $cat = $instance['cat'];
42
- $post_type = $instance['post_type'];
 
43
 
44
  echo $before_widget;
45
 
@@ -71,10 +72,26 @@ class rpwe_widget extends WP_Widget {
71
  <li class="rpwe-clearfix">
72
 
73
  <a href="<?php esc_url( the_permalink() ); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
74
- <?php if( has_post_thumbnail() && $thumb == true ) the_post_thumbnail( array( $thumb_height, $thumb_width ), array( 'class' => 'rpwe-alignleft', 'alt' => esc_attr( get_the_title() ), 'title' => esc_attr( get_the_title() ) ) ); ?>
75
- <h3 class="rpwe-title"><?php esc_attr( the_title() ); ?></h3>
 
 
 
 
 
 
 
 
 
 
76
  </a>
77
 
 
 
 
 
 
 
78
  <?php if( $excerpt == true ) { ?>
79
  <div class="rpwe-summary"><?php echo rpwe_excerpt( $length ); ?></div>
80
  <?php } ?>
@@ -108,6 +125,7 @@ class rpwe_widget extends WP_Widget {
108
  $instance['thumb_width'] = (int)( $new_instance['thumb_width'] );
109
  $instance['cat'] = $new_instance['cat'];
110
  $instance['post_type'] = $new_instance['post_type'];
 
111
 
112
  delete_transient( 'rpwewidget_' . $this->id );
113
 
@@ -125,12 +143,13 @@ class rpwe_widget extends WP_Widget {
125
  'title' => '',
126
  'limit' => 5,
127
  'excerpt' => '',
128
- 'length' => 20,
129
  'thumb' => true,
130
  'thumb_height' => 45,
131
  'thumb_width' => 45,
132
  'cat' => '',
133
- 'post_type' => ''
 
134
  );
135
 
136
  $instance = wp_parse_args( (array) $instance, $defaults );
@@ -143,6 +162,7 @@ class rpwe_widget extends WP_Widget {
143
  $thumb_width = (int)( $instance['thumb_width'] );
144
  $cat = $instance['cat'];
145
  $post_type = $instance['post_type'];
 
146
 
147
  ?>
148
 
@@ -158,6 +178,10 @@ class rpwe_widget extends WP_Widget {
158
  <?php } ?>
159
  </select>
160
  </p>
 
 
 
 
161
  <p>
162
  <label for="<?php echo esc_attr( $this->get_field_id( 'excerpt' ) ); ?>"><?php _e( 'Display excerpt?', 'rpwe' ); ?></label>
163
  <input id="<?php echo $this->get_field_id( 'excerpt' ); ?>" name="<?php echo $this->get_field_name( 'excerpt' ); ?>" type="checkbox" value="1" <?php checked( '1', $excerpt ); ?> />&nbsp;
39
  $thumb_height = (int)( $instance['thumb_height'] );
40
  $thumb_width = (int)( $instance['thumb_width'] );
41
  $cat = $instance['cat'];
42
+ $post_type = $instance['post_type'];
43
+ $date = $instance['date'];
44
 
45
  echo $before_widget;
46
 
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"><a href="<?php esc_url( the_permalink() ); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php esc_attr( the_title() ); ?></a></h3>
90
+
91
+ <?php if( $date == true ) { ?>
92
+ <span class="rpwe-time"><?php echo human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) ) . __( ' ago', 'rpwe' ); ?></span>
93
+ <?php } ?>
94
+
95
  <?php if( $excerpt == true ) { ?>
96
  <div class="rpwe-summary"><?php echo rpwe_excerpt( $length ); ?></div>
97
  <?php } ?>
125
  $instance['thumb_width'] = (int)( $new_instance['thumb_width'] );
126
  $instance['cat'] = $new_instance['cat'];
127
  $instance['post_type'] = $new_instance['post_type'];
128
+ $instance['date'] = $new_instance['date'];
129
 
130
  delete_transient( 'rpwewidget_' . $this->id );
131
 
143
  'title' => '',
144
  'limit' => 5,
145
  'excerpt' => '',
146
+ 'length' => 10,
147
  'thumb' => true,
148
  'thumb_height' => 45,
149
  'thumb_width' => 45,
150
  'cat' => '',
151
+ 'post_type' => '',
152
+ 'date' => true
153
  );
154
 
155
  $instance = wp_parse_args( (array) $instance, $defaults );
162
  $thumb_width = (int)( $instance['thumb_width'] );
163
  $cat = $instance['cat'];
164
  $post_type = $instance['post_type'];
165
+ $date = $instance['date'];
166
 
167
  ?>
168
 
178
  <?php } ?>
179
  </select>
180
  </p>
181
+ <p>
182
+ <label for="<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>"><?php _e( 'Display date?', 'rpwe' ); ?></label>
183
+ <input id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" type="checkbox" value="1" <?php checked( '1', $date ); ?> />&nbsp;
184
+ </p>
185
  <p>
186
  <label for="<?php echo esc_attr( $this->get_field_id( 'excerpt' ) ); ?>"><?php _e( 'Display excerpt?', 'rpwe' ); ?></label>
187
  <input id="<?php echo $this->get_field_id( 'excerpt' ); ?>" name="<?php echo $this->get_field_name( 'excerpt' ); ?>" type="checkbox" value="1" <?php checked( '1', $excerpt ); ?> />&nbsp;
languages/rpwe.mo CHANGED
Binary file
languages/rpwe.po CHANGED
@@ -1,61 +1,69 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Recent Posts Widget Extended 0.1\n"
4
- "POT-Creation-Date: 2012-12-03 11:37+0700\n"
5
- "PO-Revision-Date: 2012-12-03 11:39+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
-
14
- #: widget-recent-posts-extended.php:15
15
- msgid "Advanced recent posts widget."
16
- msgstr ""
17
-
18
- #: widget-recent-posts-extended.php:24
19
- msgid "&raquo; Recent Posts Widget Extended"
20
- msgstr ""
21
-
22
- #: widget-recent-posts-extended.php:74
23
- #, php-format
24
- msgid "Permalink to %s"
25
- msgstr ""
26
-
27
- #: widget-recent-posts-extended.php:153
28
- msgid "Title:"
29
- msgstr ""
30
-
31
- #: widget-recent-posts-extended.php:157
32
- msgid "Limit:"
33
- msgstr ""
34
-
35
- #: widget-recent-posts-extended.php:165
36
- msgid "Display excerpt?"
37
- msgstr ""
38
-
39
- #: widget-recent-posts-extended.php:169
40
- msgid "Excerpt length:"
41
- msgstr ""
42
-
43
- #: widget-recent-posts-extended.php:176
44
- msgid "Display thumbnail?"
45
- msgstr ""
46
-
47
- #: widget-recent-posts-extended.php:180
48
- msgid "Thumbnail size (height x width):"
49
- msgstr ""
50
-
51
- #: widget-recent-posts-extended.php:188
52
- msgid "Limit to category: "
53
- msgstr ""
54
-
55
- #: widget-recent-posts-extended.php:189
56
- msgid "All categories"
57
- msgstr ""
58
-
59
- #: widget-recent-posts-extended.php:192
60
- msgid "Choose the Post Type: "
61
- msgstr ""
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Recent Posts Widget Extended 0.4\n"
4
+ "POT-Creation-Date: 2012-12-17 15:18+0700\n"
5
+ "PO-Revision-Date: 2012-12-17 15:19+0700\n"
6
+ "Last-Translator: M.Satrya <satrya@tokokoo.com>\n"
7
+ "Language-Team: Tokokoo <support@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
+
14
+ #: widget-recent-posts-extended.php:15
15
+ msgid "Advanced recent posts widget."
16
+ msgstr ""
17
+
18
+ #: widget-recent-posts-extended.php:24
19
+ msgid "&raquo; Recent Posts Widget Extended"
20
+ msgstr ""
21
+
22
+ #: widget-recent-posts-extended.php:74 widget-recent-posts-extended.php:89
23
+ #, php-format
24
+ msgid "Permalink to %s"
25
+ msgstr ""
26
+
27
+ #: widget-recent-posts-extended.php:92
28
+ msgid " ago"
29
+ msgstr ""
30
+
31
+ #: widget-recent-posts-extended.php:170
32
+ msgid "Title:"
33
+ msgstr ""
34
+
35
+ #: widget-recent-posts-extended.php:174
36
+ msgid "Limit:"
37
+ msgstr ""
38
+
39
+ #: widget-recent-posts-extended.php:182
40
+ msgid "Display date?"
41
+ msgstr ""
42
+
43
+ #: widget-recent-posts-extended.php:186
44
+ msgid "Display excerpt?"
45
+ msgstr ""
46
+
47
+ #: widget-recent-posts-extended.php:190
48
+ msgid "Excerpt length:"
49
+ msgstr ""
50
+
51
+ #: widget-recent-posts-extended.php:197
52
+ msgid "Display thumbnail?"
53
+ msgstr ""
54
+
55
+ #: widget-recent-posts-extended.php:201
56
+ msgid "Thumbnail size (height x width):"
57
+ msgstr ""
58
+
59
+ #: widget-recent-posts-extended.php:209
60
+ msgid "Limit to category: "
61
+ msgstr ""
62
+
63
+ #: widget-recent-posts-extended.php:210
64
+ msgid "All categories"
65
+ msgstr ""
66
+
67
+ #: widget-recent-posts-extended.php:213
68
+ msgid "Choose the Post Type: "
69
+ msgstr ""
readme.txt CHANGED
@@ -3,30 +3,32 @@ Contributors: tokokoo, satrya
3
  Tags: recent posts, thumbnails, widget, widgets, sidebar, excerpt, transient api
4
  Requires at least: 3.3
5
  Tested up to: 3.5
6
- Stable tag: 0.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Provides recent posts widget with a more advanced settings.
11
 
12
  == Description ==
13
 
14
- This plugin will enable a custom and advanced recent posts widget. Allows you to display a list of the most recent posts with thumbnail and excerpt also you can display it from all or a specific category. The recent posts widget extended uses [Transients API](http://codex.wordpress.org/Transients_API) for delivering cached to optimize your site performance when used the widget.
15
 
16
  = Features Include: =
17
 
18
  * Display thumbnails, with customizable size.
19
  * Display excerpt, with customizable length.
20
  * Display from all or a specific category.
 
21
  * Post type option.
22
- * Transients API
23
-
24
- = To Do: =
25
- * Display meta(author, comment, date)
26
 
27
  = Support: =
28
  Please open issue on [github issue](https://github.com/tokokoo/recent-posts-widget-extended/issues) for any support question and translation submission.
29
 
 
 
 
30
  == Installation ==
31
 
32
  1. Upload the 'recent-posts-widget-extended' folder to the `/wp-content/plugins/` directory
@@ -37,6 +39,12 @@ Please open issue on [github issue](https://github.com/tokokoo/recent-posts-widg
37
 
38
  == Changelog ==
39
 
 
 
 
 
 
 
40
  = 0.3 =
41
  * WordPress 3.5 compatibility
42
  * Upload header image
3
  Tags: recent posts, thumbnails, widget, widgets, sidebar, excerpt, transient api
4
  Requires at least: 3.3
5
  Tested up to: 3.5
6
+ Stable tag: 0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ Provides custom, fleksible and advanced recent posts widget. Allows you to display them with thumbnails, post excerpt and more.
11
 
12
  == Description ==
13
 
14
+ This plugin will enable a custom, fleksible and advanced recent posts widget. Allows you to display a list of the most recent posts with thumbnail and excerpt also you can display it from all or a specific category. The recent posts widget extended uses [Transients API](http://codex.wordpress.org/Transients_API) for delivering cached to optimize your site performance when used the widget.
15
 
16
  = Features Include: =
17
 
18
  * Display thumbnails, with customizable size.
19
  * Display excerpt, with customizable length.
20
  * Display from all or a specific category.
21
+ * Display post date.
22
  * Post type option.
23
+ * Support `get_the_image` function.
24
+ * Transients API.
 
 
25
 
26
  = Support: =
27
  Please open issue on [github issue](https://github.com/tokokoo/recent-posts-widget-extended/issues) for any support question and translation submission.
28
 
29
+ = Infos: =
30
+ Follow us on Twitter to keep up with the latest updates [@tokokoo](http://twitter.com/tokokoo)
31
+
32
  == Installation ==
33
 
34
  1. Upload the 'recent-posts-widget-extended' folder to the `/wp-content/plugins/` directory
39
 
40
  == Changelog ==
41
 
42
+ = 0.4 =
43
+ * Add date option
44
+ * Support `get_the_image` function
45
+ * Re-arrange markup
46
+ * Update language
47
+
48
  = 0.3 =
49
  * WordPress 3.5 compatibility
50
  * Upload header image
rpwe.css CHANGED
@@ -1,7 +1,8 @@
1
  /*
2
  Description: Custom CSS for the Recent Posts Widget Extended.
3
  Version: 0.1
4
- Author: Marga Satrya
 
5
  License: GPLv2
6
  */
7
 
@@ -17,10 +18,16 @@ License: GPLv2
17
  padding-bottom: 10px;
18
  }
19
 
 
 
 
 
20
  .rpwe-block h3 {
21
  clear: none;
22
  margin-bottom: 0 !important;
23
  font-weight: normal;
 
 
24
  line-height: 1.5em;
25
  }
26
 
@@ -33,9 +40,16 @@ License: GPLv2
33
  }
34
 
35
  .rpwe-summary {
 
36
  font-size: 12px;
37
  }
38
 
 
 
 
 
 
 
39
  .rpwe-clearfix:before,
40
  .rpwe-clearfix:after {
41
  content: "";
1
  /*
2
  Description: Custom CSS for the Recent Posts Widget Extended.
3
  Version: 0.1
4
+ Revision: 0.4
5
+ Author: Satrya
6
  License: GPLv2
7
  */
8
 
18
  padding-bottom: 10px;
19
  }
20
 
21
+ .rpwe-block a {
22
+ text-decoration: none;
23
+ }
24
+
25
  .rpwe-block h3 {
26
  clear: none;
27
  margin-bottom: 0 !important;
28
  font-weight: normal;
29
+ font-size: 12px;
30
+ font-family: Arial, sans-serif;
31
  line-height: 1.5em;
32
  }
33
 
40
  }
41
 
42
  .rpwe-summary {
43
+ font-family: Arial, sans-serif;
44
  font-size: 12px;
45
  }
46
 
47
+ .rpwe-time {
48
+ color: #bbb;
49
+ font-size: 11px;
50
+ font-family: Arial, sans-serif;
51
+ }
52
+
53
  .rpwe-clearfix:before,
54
  .rpwe-clearfix:after {
55
  content: "";
rpwe.php CHANGED
@@ -3,8 +3,8 @@
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.3
7
- Author: Marga Satrya
8
  Author URI: http://tokokoo.com
9
  Author Email: satrya@tokokoo.com
10
  License: GPLv2
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.4
7
+ Author: Satrya
8
  Author URI: http://tokokoo.com
9
  Author Email: satrya@tokokoo.com
10
  License: GPLv2
screenshot-1.png CHANGED
Binary file