Recent Posts Widget Extended - Version 0.9.4

Version Description

  • =
  • Tested for WordPress 4.0.
  • The code is totally rewritten, please re-save or re-install the plugin if it doesn't work properly. I'm sorry for it.
  • After some research, I decided to get back the get_the_excerpt() as the excerpt. But now you can easily to change it via filter. Please read FAQ
  • Added: Shortcode support.
  • Added: Post status option.
  • Added: Taxonomy input to limit the posts based on taxonomy.
  • Added: Exclude sticky post.
  • Added: You can display HTML or text before or after the posts.
  • Added: Now support Siteorigin Page Builder.
  • Removed: Suppres Filter option
  • Limit to Category and Limit to Tag option will be removed in the next release, please just use the Limit to Taxonomy option to display posts based on taxonomy.
Download this release

Release Info

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

Code changes from version 0.9.3 to 0.9.4

assets/css/rpwe-admin.css CHANGED
@@ -1,9 +1,3 @@
1
- .widgets-php .rpwe-columns-2 {
2
- overflow: hidden;
3
- float: left;
4
- width: 48%;
5
- }
6
-
7
  .widgets-php .rpwe-columns-3 {
8
  overflow: hidden;
9
  float: left;
@@ -11,11 +5,6 @@
11
  margin-right: 3.5%;
12
  }
13
 
14
- .widgets-php .rpwe-columns-2 input.widefat,
15
- .widgets-php .rpwe-columns-2 select.widefat {
16
- width: 99%;
17
- }
18
-
19
  .widgets-php .rpwe-columns-3 select.widefat {
20
  width: 98.5%;
21
  }
@@ -25,13 +14,17 @@
25
  margin-right: 0;
26
  }
27
 
28
- .widgets-php .rpwe-columns-2 label,
29
  .widgets-php .rpwe-columns-3 label {
30
  font-size: 11px;
31
  }
32
 
 
 
 
 
 
33
  .small-input {
34
- width: 78px;
35
  }
36
 
37
  .rpwe-block {
 
 
 
 
 
 
1
  .widgets-php .rpwe-columns-3 {
2
  overflow: hidden;
3
  float: left;
5
  margin-right: 3.5%;
6
  }
7
 
 
 
 
 
 
8
  .widgets-php .rpwe-columns-3 select.widefat {
9
  width: 98.5%;
10
  }
14
  margin-right: 0;
15
  }
16
 
 
17
  .widgets-php .rpwe-columns-3 label {
18
  font-size: 11px;
19
  }
20
 
21
+ .widgets-php .rpwe-columns-3 p small {
22
+ color: #777;
23
+ font-style: italic;
24
+ }
25
+
26
  .small-input {
27
+ width: 30%;
28
  }
29
 
30
  .rpwe-block {
classes/widget.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The custom recent posts widget.
4
+ * This widget gives total control over the output to the user.
5
+ *
6
+ * @package Recent_Posts_Widget_Extended
7
+ * @since 0.1
8
+ * @author Satrya
9
+ * @copyright Copyright (c) 2014, Satrya
10
+ * @license http://www.gnu.org/licenses/gpl-2.0.html
11
+ */
12
+ class Recent_Posts_Widget_Extended extends WP_Widget {
13
+
14
+ /**
15
+ * Sets up the widgets.
16
+ *
17
+ * @since 0.1
18
+ */
19
+ function __construct() {
20
+
21
+ /* Set up the widget options. */
22
+ $widget_options = array(
23
+ 'classname' => 'rpwe_widget recent-posts-extended',
24
+ 'description' => __( 'An advanced widget that gives you total control over the output of your site’s most recent Posts.', 'rpwe' )
25
+ );
26
+
27
+ $control_options = array(
28
+ 'width' => 750,
29
+ 'height' => 350
30
+ );
31
+
32
+ /* Create the widget. */
33
+ $this->WP_Widget(
34
+ 'rpwe_widget', // $this->id_base
35
+ __( 'Recent Posts Extended', 'rpwe' ), // $this->name
36
+ $widget_options, // $this->widget_options
37
+ $control_options // $this->control_options
38
+ );
39
+
40
+ }
41
+
42
+ /**
43
+ * Outputs the widget based on the arguments input through the widget controls.
44
+ *
45
+ * @since 0.1
46
+ */
47
+ function widget( $args, $instance ) {
48
+ extract( $args );
49
+
50
+ // Output the theme's $before_widget wrapper.
51
+ echo $before_widget;
52
+
53
+ // If both title and title url is not empty, display it.
54
+ if ( ! empty( $instance['title_url'] ) && ! empty( $instance['title'] ) ) {
55
+ echo $before_title . '<a href="' . esc_url( $instance['title_url'] ) . '" title="' . esc_attr( $instance['title'] ) . '">' . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . '</a>' . $after_title;
56
+
57
+ // If the title not empty, display it.
58
+ } elseif ( ! empty( $instance['title'] ) ) {
59
+ echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title;
60
+ }
61
+
62
+ // Get the recent posts query.
63
+ echo rpwe_get_recent_posts( $instance );
64
+
65
+ // Close the theme's widget wrapper.
66
+ echo $after_widget;
67
+
68
+ }
69
+
70
+ /**
71
+ * Updates the widget control options for the particular instance of the widget.
72
+ *
73
+ * @since 0.1
74
+ */
75
+ function update( $new_instance, $old_instance ) {
76
+
77
+ $instance = $old_instance;
78
+ $instance['title'] = strip_tags( $new_instance['title'] );
79
+ $instance['title_url'] = esc_url( $new_instance['title_url'] );
80
+
81
+ $instance['ignore_sticky'] = isset( $new_instance['ignore_sticky'] ) ? (bool) $new_instance['ignore_sticky'] : 0;
82
+ $instance['limit'] = (int)( $new_instance['limit'] );
83
+ $instance['offset'] = (int)( $new_instance['offset'] );
84
+ $instance['order'] = $new_instance['order'];
85
+ $instance['orderby'] = $new_instance['orderby'];
86
+ $instance['cat'] = $new_instance['cat'];
87
+ $instance['tag'] = $new_instance['tag'];
88
+ $instance['post_type'] = esc_attr( $new_instance['post_type'] );
89
+ $instance['post_status'] = esc_attr( $new_instance['post_status'] );
90
+ $instance['taxonomy'] = esc_attr( $new_instance['taxonomy'] );
91
+
92
+ $instance['excerpt'] = isset( $new_instance['excerpt'] ) ? (bool) $new_instance['excerpt'] : false;
93
+ $instance['length'] = (int)( $new_instance['length'] );
94
+ $instance['date'] = isset( $new_instance['date'] ) ? (bool) $new_instance['date'] : false;
95
+ $instance['readmore'] = isset( $new_instance['readmore'] ) ? (bool) $new_instance['readmore'] : false;
96
+ $instance['readmore_text'] = strip_tags( $new_instance['readmore_text'] );
97
+
98
+ $instance['thumb'] = isset( $new_instance['thumb'] ) ? (bool) $new_instance['thumb'] : false;
99
+ $instance['thumb_height'] = (int)( $new_instance['thumb_height'] );
100
+ $instance['thumb_width'] = (int)( $new_instance['thumb_width'] );
101
+ $instance['thumb_default'] = esc_url( $new_instance['thumb_default'] );
102
+ $instance['thumb_align'] = esc_attr( $new_instance['thumb_align'] );
103
+
104
+ $instance['styles_default'] = isset( $new_instance['styles_default'] ) ? (bool) $new_instance['styles_default'] : false;
105
+ $instance['cssID'] = sanitize_html_class( $new_instance['cssID'] );
106
+ $instance['css'] = $new_instance['css'];
107
+ $instance['before'] = wp_filter_post_kses( $new_instance['before'] );
108
+ $instance['after'] = wp_filter_post_kses( $new_instance['after'] );
109
+
110
+ return $instance;
111
+
112
+ }
113
+
114
+ /**
115
+ * Displays the widget control options in the Widgets admin screen.
116
+ *
117
+ * @since 0.1
118
+ */
119
+ function form( $instance ) {
120
+
121
+ // Merge the user-selected arguments with the defaults.
122
+ $instance = wp_parse_args( (array) $instance, rpwe_get_default_args() );
123
+
124
+ // Extract the array to allow easy use of variables.
125
+ extract( $instance );
126
+
127
+ // Loads the widget form.
128
+ include( RPWE_INCLUDES . 'form.php' );
129
+
130
+ }
131
+
132
+ }
includes/form.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Widget forms.
4
+ *
5
+ * @package Recent_Posts_Widget_Extended
6
+ * @since 0.9.4
7
+ * @author Satrya
8
+ * @copyright Copyright (c) 2014, Satrya
9
+ * @license http://www.gnu.org/licenses/gpl-2.0.html
10
+ */
11
+ ?>
12
+
13
+ <div class="rpwe-columns-3">
14
+
15
+ <p>
16
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>">
17
+ <?php _e( 'Title', 'rpwe' ); ?>
18
+ </label>
19
+ <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'] ); ?>" />
20
+ </p>
21
+
22
+ <p>
23
+ <label for="<?php echo $this->get_field_id( 'title_url' ); ?>">
24
+ <?php _e( 'Title URL', 'rpwe' ); ?>
25
+ </label>
26
+ <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'] ); ?>" />
27
+ </p>
28
+
29
+ <p>
30
+ <label for="<?php echo $this->get_field_id( 'cssID' ); ?>">
31
+ <?php _e( 'CSS ID', 'rpwe' ); ?>
32
+ </label>
33
+ <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'] ); ?>"/>
34
+ </p>
35
+
36
+ <p>
37
+ <input id="<?php echo $this->get_field_id( 'styles_default' ); ?>" name="<?php echo $this->get_field_name( 'styles_default' ); ?>" type="checkbox" <?php checked( $instance['styles_default'] ); ?> />
38
+ <label class="input-checkbox" for="<?php echo $this->get_field_id( 'styles_default' ); ?>">
39
+ <?php _e( 'Use Default Styles', 'rpwe' ); ?>
40
+ </label>
41
+ </p>
42
+
43
+ <p>
44
+ <label for="<?php echo $this->get_field_id( 'before' ); ?>">
45
+ <?php _e( 'HTML or text before the recent posts', 'rpwe' );?>
46
+ </label>
47
+ <textarea class="widefat" id="<?php echo $this->get_field_id( 'before' ); ?>" name="<?php echo $this->get_field_name( 'before' ); ?>" rows="5"><?php echo htmlspecialchars( stripslashes( $instance['before'] ) ); ?></textarea>
48
+ </p>
49
+
50
+ <p>
51
+ <label for="<?php echo $this->get_field_id( 'after' ); ?>">
52
+ <?php _e( 'HTML or text after the recent posts', 'rpwe' );?>
53
+ </label>
54
+ <textarea class="widefat" id="<?php echo $this->get_field_id( 'after' ); ?>" name="<?php echo $this->get_field_name( 'after' ); ?>" rows="5"><?php echo htmlspecialchars( stripslashes( $instance['after'] ) ); ?></textarea>
55
+ </p>
56
+
57
+ </div>
58
+
59
+ <div class="rpwe-columns-3">
60
+
61
+ <p>
62
+ <input class="checkbox" type="checkbox" <?php checked( $instance['ignore_sticky'], 1 ); ?> id="<?php echo $this->get_field_id( 'ignore_sticky' ); ?>" name="<?php echo $this->get_field_name( 'ignore_sticky' ); ?>" />
63
+ <label for="<?php echo $this->get_field_id( 'ignore_sticky' ); ?>">
64
+ <?php _e( 'Ignore sticky posts', 'rpwe' ); ?>
65
+ </label>
66
+ </p>
67
+
68
+ <p>
69
+ <label for="<?php echo $this->get_field_id( 'post_type' ); ?>">
70
+ <?php _e( 'Post Type', 'rpwe' ); ?>
71
+ </label>
72
+ <?php /* pros Justin Tadlock - http://themehybrid.com/ */ ?>
73
+ <select class="widefat" id="<?php echo $this->get_field_id( 'post_type' ); ?>" name="<?php echo $this->get_field_name( 'post_type' ); ?>">
74
+ <option value="any" <?php selected( 'any', $instance['post_type'] ); ?>><?php _e( 'Any', 'rpwe' ); ?></option>
75
+ <?php foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $post_type ) { ?>
76
+ <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>
77
+ <?php } ?>
78
+ </select>
79
+ </p>
80
+
81
+ <p>
82
+ <label for="<?php echo $this->get_field_id( 'post_status' ); ?>">
83
+ <?php _e( 'Post Status', 'rpwe' ); ?>
84
+ </label>
85
+ <select class="widefat" id="<?php echo $this->get_field_id( 'post_status' ); ?>" name="<?php echo $this->get_field_name( 'post_status' ); ?>" style="width:100%;">
86
+ <?php foreach ( get_available_post_statuses() as $status_value => $status_label ) { ?>
87
+ <option value="<?php echo esc_attr( $status_label ); ?>" <?php selected( $instance['post_status'], $status_label ); ?>><?php echo esc_html( ucfirst( $status_label ) ); ?></option>
88
+ <?php } ?>
89
+ </select>
90
+ </p>
91
+
92
+ <p>
93
+ <label for="<?php echo $this->get_field_id( 'order' ); ?>">
94
+ <?php _e( 'Order', 'rpwe' ); ?>
95
+ </label>
96
+ <select class="widefat" id="<?php echo $this->get_field_id( 'order' ); ?>" name="<?php echo $this->get_field_name( 'order' ); ?>" style="width:100%;">
97
+ <option value="DESC" <?php selected( $instance['order'], 'DESC' ); ?>><?php _e( 'Descending', 'rpwe' ) ?></option>
98
+ <option value="ASC" <?php selected( $instance['order'], 'ASC' ); ?>><?php _e( 'Ascending', 'rpwe' ) ?></option>
99
+ </select>
100
+ </p>
101
+
102
+ <p>
103
+ <label for="<?php echo $this->get_field_id( 'orderby' ); ?>">
104
+ <?php _e( 'Orderby', 'rpwe' ); ?>
105
+ </label>
106
+ <select class="widefat" id="<?php echo $this->get_field_id( 'orderby' ); ?>" name="<?php echo $this->get_field_name( 'orderby' ); ?>" style="width:100%;">
107
+ <option value="ID" <?php selected( $instance['orderby'], 'ID' ); ?>><?php _e( 'ID', 'rpwe' ) ?></option>
108
+ <option value="author" <?php selected( $instance['orderby'], 'author' ); ?>><?php _e( 'Author', 'rpwe' ) ?></option>
109
+ <option value="title" <?php selected( $instance['orderby'], 'title' ); ?>><?php _e( 'Title', 'rpwe' ) ?></option>
110
+ <option value="date" <?php selected( $instance['orderby'], 'date' ); ?>><?php _e( 'Date', 'rpwe' ) ?></option>
111
+ <option value="modified" <?php selected( $instance['orderby'], 'modified' ); ?>><?php _e( 'Modified', 'rpwe' ) ?></option>
112
+ <option value="rand" <?php selected( $instance['orderby'], 'rand' ); ?>><?php _e( 'Random', 'rpwe' ) ?></option>
113
+ <option value="comment_count" <?php selected( $instance['orderby'], 'comment_count' ); ?>><?php _e( 'Comment Count', 'rpwe' ) ?></option>
114
+ <option value="menu_order" <?php selected( $instance['orderby'], 'menu_order' ); ?>><?php _e( 'Menu Order', 'rpwe' ) ?></option>
115
+ </select>
116
+ </p>
117
+
118
+ <p>
119
+ <label for="<?php echo $this->get_field_id( 'cat' ); ?>">
120
+ <?php _e( 'Limit to Category', 'rpwe' ); ?>
121
+ </label>
122
+ <select class="widefat" multiple="multiple" id="<?php echo $this->get_field_id( 'cat' ); ?>" name="<?php echo $this->get_field_name( 'cat' ); ?>[]" style="width:100%;">
123
+ <optgroup label="Categories">
124
+ <?php $categories = get_terms( 'category' ); ?>
125
+ <?php foreach( $categories as $category ) { ?>
126
+ <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>
127
+ <?php } ?>
128
+ </optgroup>
129
+ </select>
130
+ <small>Please just use the <strong>Limit to Taxonomy</strong> option to display posts based on category, I will remove this option in the next release.</small>
131
+ </p>
132
+
133
+ <p>
134
+ <label for="<?php echo $this->get_field_id( 'tag' ); ?>">
135
+ <?php _e( 'Limit to Tag', 'rpwe' ); ?>
136
+ </label>
137
+ <select class="widefat" multiple="multiple" id="<?php echo $this->get_field_id( 'tag' ); ?>" name="<?php echo $this->get_field_name( 'tag' ); ?>[]" style="width:100%;">
138
+ <optgroup label="Tags">
139
+ <?php $tags = get_terms( 'post_tag' ); ?>
140
+ <?php foreach( $tags as $post_tag ) { ?>
141
+ <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>
142
+ <?php } ?>
143
+ </optgroup>
144
+ </select>
145
+ <small>Please just use the <strong>Limit to Taxonomy</strong> option to display posts based on tag, I will remove this option in the next release.</small>
146
+ </p>
147
+
148
+ <p>
149
+ <label for="<?php echo $this->get_field_id( 'taxonomy' ); ?>">
150
+ <?php _e( 'Limit to Taxonomy', 'rpwe' ); ?>
151
+ </label>
152
+ <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'taxonomy' ); ?>" name="<?php echo $this->get_field_name( 'taxonomy' ); ?>" value="<?php echo esc_attr( $instance['taxonomy'] ); ?>" />
153
+ <small><?php _e( 'Ex: category=1,2,4&amp;post_tag=6,12', 'rpwe' );?><br />
154
+ <?php _e( 'Available: ', 'rpwe' ); echo implode( ', ', get_taxonomies( array( 'public' => true ) ) ); ?></small>
155
+ </p>
156
+
157
+ </div>
158
+
159
+ <div class="rpwe-columns-3 rpwe-column-last">
160
+
161
+ <p>
162
+ <label for="<?php echo $this->get_field_id( 'limit' ); ?>">
163
+ <?php _e( 'Number of posts to show', 'rpwe' ); ?>
164
+ </label>
165
+ <input class="widefat" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="number" step="1" min="-1" value="<?php echo (int)( $instance['limit'] ); ?>" />
166
+ </p>
167
+
168
+ <p>
169
+ <label for="<?php echo $this->get_field_id( 'offset' ); ?>">
170
+ <?php _e( 'Offset (the number of posts to skip)', 'rpwe' ); ?>
171
+ </label>
172
+ <input class="widefat" id="<?php echo $this->get_field_id( 'offset' ); ?>" name="<?php echo $this->get_field_name( 'offset' ); ?>" type="number" step="1" min="0" value="<?php echo (int)( $instance['offset'] ); ?>" />
173
+ </p>
174
+
175
+ <?php if ( current_theme_supports( 'post-thumbnails' ) ) { ?>
176
+
177
+ <p>
178
+ <input id="<?php echo $this->get_field_id( 'thumb' ); ?>" name="<?php echo $this->get_field_name( 'thumb' ); ?>" type="checkbox" <?php checked( $instance['thumb'] ); ?> />
179
+ <label class="input-checkbox" for="<?php echo $this->get_field_id( 'thumb' ); ?>">
180
+ <?php _e( 'Display Thumbnail', 'rpwe' ); ?>
181
+ </label>
182
+ </p>
183
+
184
+ <p>
185
+ <label class="rpwe-block" for="<?php echo $this->get_field_id( 'thumb_height' ); ?>">
186
+ <?php _e( 'Thumbnail (width,height,align)', 'rpwe' ); ?>
187
+ </label>
188
+ <input class= "small-input" id="<?php echo $this->get_field_id( 'thumb_height' ); ?>" name="<?php echo $this->get_field_name( 'thumb_height' ); ?>" type="number" step="1" min="0" value="<?php echo (int)( $instance['thumb_height'] ); ?>" />
189
+ <input class="small-input" id="<?php echo $this->get_field_id( 'thumb_width' ); ?>" name="<?php echo $this->get_field_name( 'thumb_width' ); ?>" type="number" step="1" min="0" value="<?php echo (int)( $instance['thumb_width'] ); ?>"/>
190
+ <select class="small-input" id="<?php echo $this->get_field_id( 'thumb_align' ); ?>" name="<?php echo $this->get_field_name( 'thumb_align' ); ?>">
191
+ <option value="rpwe-alignleft" <?php selected( $instance['thumb_align'], 'rpwe-alignleft' ); ?>><?php _e( 'Left', 'rpwe' ) ?></option>
192
+ <option value="rpwe-alignright" <?php selected( $instance['thumb_align'], 'rpwe-alignright' ); ?>><?php _e( 'Right', 'rpwe' ) ?></option>
193
+ <option value="rpwe-aligncenter" <?php selected( $instance['thumb_align'], 'rpwe-aligncenter' ); ?>><?php _e( 'Center', 'rpwe' ) ?></option>
194
+ </select>
195
+ </p>
196
+
197
+ <p>
198
+ <label for="<?php echo $this->get_field_id( 'thumb_default' ); ?>">
199
+ <?php _e( 'Default Thumbnail', 'rpwe' ); ?>
200
+ </label>
201
+ <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']; ?>"/>
202
+ <small><?php _e( 'Leave it blank to disable.', 'rpwe' ); ?></small>
203
+ </p>
204
+
205
+ <?php } ?>
206
+
207
+ <p>
208
+ <input id="<?php echo $this->get_field_id( 'excerpt' ); ?>" name="<?php echo $this->get_field_name( 'excerpt' ); ?>" type="checkbox" <?php checked( $instance['excerpt'] ); ?> />
209
+ <label class="input-checkbox" for="<?php echo $this->get_field_id( 'excerpt' ); ?>">
210
+ <?php _e( 'Display Excerpt', 'rpwe' ); ?>
211
+ </label>
212
+ </p>
213
+
214
+ <p>
215
+ <label for="<?php echo $this->get_field_id( 'length' ); ?>">
216
+ <?php _e( 'Excerpt Length', 'rpwe' ); ?>
217
+ </label>
218
+ <input class="widefat" id="<?php echo $this->get_field_id( 'length' ); ?>" name="<?php echo $this->get_field_name( 'length' ); ?>" type="number" step="1" min="0" value="<?php echo (int)( $instance['length'] ); ?>" />
219
+ </p>
220
+
221
+ <p>
222
+ <input id="<?php echo $this->get_field_id( 'readmore' ); ?>" name="<?php echo $this->get_field_name( 'readmore' ); ?>" type="checkbox" <?php checked( $instance['readmore'] ); ?> />
223
+ <label class="input-checkbox" for="<?php echo $this->get_field_id( 'readmore' ); ?>">
224
+ <?php _e( 'Display Readmore', 'rpwe' ); ?>
225
+ </label>
226
+ </p>
227
+
228
+ <p>
229
+ <label for="<?php echo $this->get_field_id( 'readmore_text' ); ?>">
230
+ <?php _e( 'Readmore Text', 'rpwe' ); ?>
231
+ </label>
232
+ <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'] ); ?>" />
233
+ </p>
234
+
235
+ <p>
236
+ <input id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" type="checkbox" <?php checked( $instance['date'] ); ?> />
237
+ <label class="input-checkbox" for="<?php echo $this->get_field_id( 'date' ); ?>">
238
+ <?php _e( 'Display Date', 'rpwe' ); ?>
239
+ </label>
240
+ </p>
241
+
242
+ </div>
243
+
244
+ <div class="clear"></div>
245
+
246
+ <p>
247
+ <label for="<?php echo $this->get_field_id( 'css' ); ?>">
248
+ <?php _e( 'Custom CSS', 'rpwe' ); ?>
249
+ </label>
250
+ <textarea class="widefat" id="<?php echo $this->get_field_id( 'css' ); ?>" name="<?php echo $this->get_field_name( 'css' ); ?>" style="height:150px;"><?php echo $instance['css']; ?></textarea>
251
+ <small><?php _e( 'If you turn off the default styles, you can use these css code to customize the recent posts style.', 'rpwe' ); ?></small>
252
+ </p>
includes/functions.php ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Various functions used by the plugin.
4
+ *
5
+ * @package Recent_Posts_Widget_Extended
6
+ * @since 0.9.4
7
+ * @author Satrya
8
+ * @copyright Copyright (c) 2014, Satrya
9
+ * @license http://www.gnu.org/licenses/gpl-2.0.html
10
+ */
11
+
12
+ /**
13
+ * Sets up the default arguments.
14
+ *
15
+ * @since 0.9.4
16
+ */
17
+ function rpwe_get_default_args() {
18
+
19
+ $css_defaults = ".rpwe-block ul{\nlist-style: none !important;\nmargin-left: 0 !important;\npadding-left: 0 !important;\n}\n\n.rpwe-block li{\nborder-bottom: 1px solid #eee;\nmargin-bottom: 10px;\npadding-bottom: 10px;\nlist-style-type: none;\n}\n\n.rpwe-block a{\ndisplay: inline !important;\ntext-decoration: none;\n}\n\n.rpwe-block h3{\nbackground: none !important;\nclear: none;\nmargin-bottom: 0 !important;\nmargin-top: 0 !important;\nfont-weight: 400;\nfont-size: 12px !important;\nline-height: 1.5em;\n}\n\n.rpwe-thumb{\nborder: 1px solid #eee !important;\nbox-shadow: none !important;\nmargin: 2px 10px 2px 0;\npadding: 3px !important;\n}\n\n.rpwe-summary{\nfont-size: 12px;\n}\n\n.rpwe-time{\ncolor: #bbb;\nfont-size: 11px;\n}\n\n.rpwe-alignleft{\ndisplay: inline;\nfloat: left;\n}\n\n.rpwe-alignright{\ndisplay: inline;\nfloat: right;\n}\n\n.rpwe-aligncenter{\ndisplay: block;\nmargin-left: auto;\nmargin-right: auto;\n}\n\n.rpwe-clearfix:before,\n.rpwe-clearfix:after{\ncontent: \"\";\ndisplay: table !important;\n}\n\n.rpwe-clearfix:after{\nclear: both;\n}\n\n.rpwe-clearfix{\nzoom: 1;\n}\n";
20
+
21
+ $defaults = array(
22
+ 'title' => esc_attr__( 'Recent Posts', 'rpwe' ),
23
+ 'title_url' => '',
24
+
25
+ 'limit' => 5,
26
+ 'offset' => 0,
27
+ 'order' => 'DESC',
28
+ 'orderby' => 'date',
29
+ 'cat' => '',
30
+ 'tag' => '',
31
+ 'taxonomy' => '',
32
+ 'post_type' => 'post',
33
+ 'post_status' => 'publish',
34
+ 'ignore_sticky' => 1,
35
+
36
+ 'excerpt' => false,
37
+ 'length' => 10,
38
+ 'thumb' => true,
39
+ 'thumb_height' => 45,
40
+ 'thumb_width' => 45,
41
+ 'thumb_default' => 'http://placehold.it/45x45/f0f0f0/ccc',
42
+ 'thumb_align' => 'rpwe-alignleft',
43
+ 'date' => true,
44
+ 'readmore' => false,
45
+ 'readmore_text' => __( 'Read More &raquo;', 'rpwe' ),
46
+
47
+ 'styles_default' => true,
48
+ 'css' => $css_defaults,
49
+ 'cssID' => '',
50
+ 'before' => '',
51
+ 'after' => ''
52
+ );
53
+
54
+ // Allow plugins/themes developer to filter the default arguments.
55
+ return apply_filters( 'rpwe_default_args', $defaults );
56
+
57
+ }
58
+
59
+ /**
60
+ * Outputs the recent posts.
61
+ *
62
+ * @since 0.9.4
63
+ */
64
+ function rpwe_recent_posts( $args = array() ) {
65
+ echo rpwe_get_recent_posts( $args );
66
+ }
67
+
68
+ /**
69
+ * Generates the posts markup.
70
+ *
71
+ * @since 0.9.4
72
+ * @param array $args
73
+ * @return string|array The HTML for the random posts.
74
+ */
75
+ function rpwe_get_recent_posts( $args = array() ) {
76
+
77
+ // Set up a default, empty variable.
78
+ $html = '';
79
+
80
+ // Get the default arguments.
81
+ $defaults = rpwe_get_default_args();
82
+
83
+ // Merge the input arguments and the defaults.
84
+ $args = wp_parse_args( $args, $defaults );
85
+
86
+ // Extract the array to allow easy use of variables.
87
+ extract( $args );
88
+
89
+ // Allow devs to hook in stuff before the loop.
90
+ do_action( 'rpwe_before_loop' );
91
+
92
+ // Get the posts query.
93
+ $posts = rpwe_get_posts( $args );
94
+
95
+ if ( $posts->have_posts() ) :
96
+
97
+ $html = '<div ' . ( ! empty( $args['cssID'] ) ? 'id="' . sanitize_html_class( $args['cssID'] ) . '"' : '' ) . ' class="rpwe-block rpwe-recent-' . sanitize_html_class( $args['post_type'] ) . '">';
98
+
99
+ $html .= '<ul class="rpwe-ul">';
100
+
101
+ while ( $posts->have_posts() ) : $posts->the_post();
102
+
103
+ $html .= '<li class="rpwe-li rpwe-clearfix">';
104
+
105
+ if ( $args['thumb'] ) :
106
+
107
+ // Check if post has post thumbnail.
108
+ if ( has_post_thumbnail() ) :
109
+ $html .= '<a href="' . get_permalink() . '" rel="bookmark">';
110
+ $html .= get_the_post_thumbnail( get_the_ID(),
111
+ array( $args['thumb_width'], $args['thumb_height'], true ),
112
+ array(
113
+ 'class' => $args['thumb_align'] . ' rpwe-thumb the-post-thumbnail',
114
+ 'alt' => esc_attr( get_the_title() )
115
+ )
116
+ );
117
+ $html .= '</a>';
118
+
119
+ // If no post thumbnail found, check if Get The Image plugin exist and display the image.
120
+ elseif ( function_exists( 'get_the_image' ) ) :
121
+ $html .= get_the_image( array(
122
+ 'height' => $args['thumb_height'],
123
+ 'width' => $args['thumb_width'],
124
+ 'size' => 'rpwe-thumbnail',
125
+ 'image_class' => $args['thumb_align'] . ' rpwe-thumb get-the-image',
126
+ 'image_scan' => true,
127
+ 'default_image' => $args['thumb_default']
128
+ ) );
129
+
130
+ // Display default image.
131
+ elseif ( ! empty( $args['thumb_default'] ) ) :
132
+ $html .= sprintf( '<a href="%1$s" rel="bookmark"><img class="%2$s rpwe-thumb rpwe-default-thumb" src="%3$s" alt="%4$s" width="%5$s" height="%6$s"></a>',
133
+ esc_url( get_permalink() ),
134
+ $args['thumb_align'],
135
+ $args['thumb_default'],
136
+ esc_attr( get_the_title() ),
137
+ $args['thumb_width'],
138
+ $args['thumb_height']
139
+ );
140
+
141
+ endif;
142
+
143
+ endif;
144
+
145
+ $html .= '<h3 class="rpwe-title"><a href="' . esc_url( get_permalink() ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'rpwe' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark">' . esc_attr( get_the_title() ) . '</a></h3>';
146
+
147
+ if ( $args['date'] ) :
148
+ $html .= '<time class="rpwe-time published" datetime="' . esc_html( get_the_date( 'c' ) ) . '">' . esc_html( get_the_date() ) . '</time>';
149
+ endif;
150
+
151
+ if ( $args['excerpt'] ) :
152
+ $html .= '<div class="rpwe-summary">';
153
+ $html .= wp_trim_words( apply_filters( 'rpwe_excerpt', get_the_excerpt() ), $args['length'], ' &hellip;' );
154
+ if ( $args['readmore'] ) :
155
+ $html .= '<a href="' . esc_url( get_permalink() ) . '" class="more-link">' . $args['readmore_text'] . '</a>';
156
+ endif;
157
+ $html .= '</div>';
158
+ endif;
159
+
160
+ $html .= '</li>';
161
+
162
+ endwhile;
163
+
164
+ $html .= '</ul>';
165
+
166
+ $html .= '</div><!-- Generated by http://wordpress.org/plugins/recent-posts-widget-extended/ -->';
167
+
168
+ endif;
169
+
170
+ // Restore original Post Data.
171
+ wp_reset_postdata();
172
+
173
+ // Allow devs to hook in stuff after the loop.
174
+ do_action( 'rpwe_after_loop' );
175
+
176
+ // Return the posts markup.
177
+ return $args['before'] . apply_filters( 'rpwe_markup', $html ) . $args['after'];
178
+
179
+ }
180
+
181
+ /**
182
+ * The posts query.
183
+ *
184
+ * @since 0.0.1
185
+ * @param array $args
186
+ * @return array
187
+ */
188
+ function rpwe_get_posts( $args = array() ) {
189
+
190
+ /**
191
+ * Taxonomy query.
192
+ * Prop Miniloop plugin by Kailey Lampert.
193
+ */
194
+ parse_str( $args['taxonomy'], $taxes );
195
+ $tax_query = array();
196
+ foreach( array_keys( $taxes ) as $k => $slug ) {
197
+ $ids = explode( ',', $taxes[$slug] );
198
+ $tax_query[] = array(
199
+ 'taxonomy' => $slug,
200
+ 'field' => 'id',
201
+ 'terms' => $ids,
202
+ 'operator' => 'IN'
203
+ );
204
+ };
205
+
206
+ // Array categories
207
+ if ( $args['cat'] && ! is_array( $args['cat'] ) ) {
208
+ $args['cat'] = explode( ',', $args['cat'] );
209
+ } else {
210
+ $args['cat'] = NULL;
211
+ }
212
+
213
+ // Array tags
214
+ if ( $args['tag'] && ! is_array( $args['tag'] ) ) {
215
+ $args['tag'] = explode( ',', $args['tag'] );
216
+ } else {
217
+ $args['tag'] = NULL;
218
+ }
219
+
220
+ // Query arguments.
221
+ $query = array(
222
+ 'offset' => $args['offset'],
223
+ 'posts_per_page' => $args['limit'],
224
+ 'orderby' => $args['orderby'],
225
+ 'order' => $args['order'],
226
+ 'post_type' => $args['post_type'],
227
+ 'post_status' => $args['post_status'],
228
+ 'ignore_sticky_posts' => $args['ignore_sticky'],
229
+ 'category__in' => $args['cat'],
230
+ 'tag__in' => $args['tag'],
231
+ 'tax_query' => $tax_query,
232
+ );
233
+
234
+ // Allow plugins/themes developer to filter the default query.
235
+ $query = apply_filters( 'rpwe_default_query_arguments', $query );
236
+
237
+ // Perform the query.
238
+ $posts = new WP_Query( $query );
239
+
240
+ return $posts;
241
+
242
+ }
includes/shortcode.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shortcode helper
4
+ *
5
+ * @package Recent_Posts_Widget_Extended
6
+ * @since 0.9.4
7
+ * @author Satrya
8
+ * @copyright Copyright (c) 2014, Satrya
9
+ * @license http://www.gnu.org/licenses/gpl-2.0.html
10
+ */
11
+
12
+ /**
13
+ * Display recent posts with shortcode.
14
+ *
15
+ * @since 0.9.4
16
+ */
17
+ function rpwe_shortcode( $atts, $content ) {
18
+ $args = shortcode_atts( rpwe_get_default_args(), $atts );
19
+ return rpwe_get_recent_posts( $args );
20
+ }
21
+ add_shortcode( 'rpwe', 'rpwe_shortcode' );
includes/style.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Custom style for the plugin front-end.
4
+ *
5
+ * @package Recent_Posts_Widget_Extended
6
+ * @since 0.9.4
7
+ * @author Satrya
8
+ * @copyright Copyright (c) 2014, Satrya
9
+ * @license http://www.gnu.org/licenses/gpl-2.0.html
10
+ */
11
+
12
+ /**
13
+ * Custom style.
14
+ *
15
+ * @since 0.9.4
16
+ */
17
+ function rpwe_style( $args = array() ) {
18
+
19
+ // Merge the input arguments and the defaults.
20
+ $args = wp_parse_args( $args, rpwe_get_default_args() );
21
+
22
+ // Extract the array to allow easy use of variables.
23
+ extract( $args );
24
+
25
+ // Display the default style of the plugin.
26
+ if ( $args['styles_default'] == true ) {
27
+ rpwe_custom_styles();
28
+ }
29
+
30
+ // If the default style are disable then use the custom css.
31
+ if ( $args['styles_default'] == false && ! empty( $args['css'] ) ) {
32
+ echo '<style>' . $args['css'] . '</style>';
33
+ }
34
+
35
+ }
36
+ add_action( 'rpwe_before_loop', 'rpwe_style', 1 );
37
+
38
+ /**
39
+ * Custom Styles.
40
+ *
41
+ * @since 0.8
42
+ */
43
+ function rpwe_custom_styles() {
44
+ ?>
45
+ <style>
46
+ .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-aligncenter{display:block;margin-left: auto;margin-right: auto;}.rpwe-clearfix:before,.rpwe-clearfix:after{content:"";display:table !important;}.rpwe-clearfix:after{clear:both;}.rpwe-clearfix{zoom:1;}
47
+ </style>
48
+ <?php
49
+ }
includes/widget-recent-posts-extended.php DELETED
@@ -1,515 +0,0 @@
1
- <?php
2
- /**
3
- * The custom recent posts widget.
4
- * This widget gives total control over the output to the user.
5
- *
6
- * @package Recent_Posts_Widget_Extended
7
- * @since 0.1
8
- * @author Satrya
9
- * @copyright Copyright (c) 2014, Satrya
10
- * @license http://www.gnu.org/licenses/gpl-2.0.html
11
- */
12
- class Recent_Posts_Widget_Extended extends WP_Widget {
13
-
14
- /**
15
- * Sets up the widgets.
16
- *
17
- * @since 0.1
18
- */
19
- function __construct() {
20
-
21
- /* Set up the widget options. */
22
- $widget_options = array(
23
- 'classname' => 'rpwe_widget recent-posts-extended',
24
- 'description' => __( 'An advanced widget that gives you total control over the output of your site’s most recent Posts.', 'rpwe' )
25
- );
26
-
27
- $control_options = array(
28
- 'width' => 800,
29
- 'height' => 350
30
- );
31
-
32
- /* Create the widget. */
33
- $this->WP_Widget(
34
- 'rpwe_widget', // $this->id_base
35
- __( 'Recent Posts Extended', 'rpwe' ), // $this->name
36
- $widget_options, // $this->widget_options
37
- $control_options // $this->control_options
38
- );
39
-
40
- }
41
-
42
- /**
43
- * Outputs the widget based on the arguments input through the widget controls.
44
- *
45
- * @since 0.1
46
- */
47
- function widget( $args, $instance ) {
48
- extract( $args, EXTR_SKIP );
49
-
50
- $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
51
- $title_url = esc_url( $instance['title_url'] );
52
- $cssID = $instance['cssID'];
53
- $limit = (int)( $instance['limit'] );
54
- $offset = (int)( $instance['offset'] );
55
- $order = $instance['order'];
56
- $orderby = $instance['orderby'];
57
- $excerpt = $instance['excerpt'];
58
- $length = (int)( $instance['length'] );
59
- $thumb = $instance['thumb'];
60
- $thumb_height = (int)( $instance['thumb_height'] );
61
- $thumb_width = (int)( $instance['thumb_width'] );
62
- $thumb_default = esc_url( $instance['thumb_default'] );
63
- $thumb_align = sanitize_html_class( $instance['thumb_align'] );
64
- $cat = $instance['cat'];
65
- $tag = $instance['tag'];
66
- $post_type = $instance['post_type'];
67
- $date = $instance['date'];
68
- $readmore = $instance['readmore'];
69
- $readmore_text = strip_tags( $instance['readmore_text'] );
70
- $styles_default = $instance['styles_default'];
71
- $css = wp_filter_nohtml_kses( $instance['css'] );
72
-
73
- echo $before_widget;
74
-
75
- /* Display the default style of the plugin. */
76
- if ( $styles_default == true ) {
77
- rpwe_custom_styles();
78
- }
79
-
80
- /* If the default style are disable then use the custom css. */
81
- if ( $styles_default == false && ! empty( $css ) ) {
82
- echo '<style>' . $css . '</style>';
83
- }
84
-
85
- /* If both title and title url not empty then display the data. */
86
- if ( ! empty( $title_url ) && ! empty( $title ) ) {
87
- echo $before_title . '<a href="' . $title_url . '" title="' . esc_attr( $title ) . '">' . $title . '</a>' . $after_title;
88
- /* If title not empty and title url empty then display just the title. */
89
- } elseif ( ! empty( $title ) ) {
90
- echo $before_title . $title . $after_title;
91
- }
92
-
93
- global $post;
94
-
95
- /* Set up the query arguments. */
96
- $args = array(
97
- 'posts_per_page' => $limit,
98
- 'category__in' => $cat,
99
- 'tag__in' => $tag,
100
- 'post_type' => $post_type,
101
- 'offset' => $offset,
102
- 'order' => $order,
103
- 'orderby' => $orderby,
104
- 'suppress_filters' => $instance['suppress_filters']
105
- );
106
-
107
- /* Allow developer to filter the query. */
108
- $default_args = apply_filters( 'rpwe_default_query_arguments', $args );
109
-
110
- /**
111
- * The main Query
112
- *
113
- * @link http://codex.wordpress.org/Function_Reference/get_posts
114
- */
115
- $rpwewidget = get_posts( $default_args );
116
-
117
- /* Check if posts exist. */
118
- if ( $rpwewidget ) {
119
- ?>
120
-
121
- <div <?php echo( ! empty( $cssID ) ? 'id="' . $cssID . '"' : '' ); ?> class="rpwe-block">
122
-
123
- <ul class="rpwe-ul">
124
-
125
- <?php foreach ( $rpwewidget as $post ) : setup_postdata( $post ); ?>
126
-
127
- <li class="rpwe-clearfix">
128
-
129
- <?php if ( $thumb == true ) { // Check if the thumbnail option enable. ?>
130
-
131
- <?php if ( has_post_thumbnail() ) { // Check If post has post thumbnail. ?>
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>
142
-
143
- <?php } elseif ( function_exists( 'get_the_image' ) ) { // Check if get-the-image plugin installed and active. ?>
144
-
145
- <?php get_the_image( array(
146
- 'height' => $thumb_height,
147
- 'width' => $thumb_width,
148
- 'size' => 'rpwe-thumbnail',
149
- 'image_class' => $thumb_align . ' rpwe-thumb get-the-image',
150
- 'image_scan' => true,
151
- 'default_image' => $thumb_default
152
- ) ); ?>
153
-
154
- <?php } elseif ( $thumb_default ) { // Check if the default image not empty. ?>
155
-
156
- <?php
157
- printf( '<a href="%1$s" rel="bookmark"><img class="%2$s rpwe-thumb rpwe-default-thumb" src="%3$s" alt="%4$s" width="%5$s" height="%6$s"></a>',
158
- esc_url( get_permalink() ),
159
- $thumb_align,
160
- $thumb_default,
161
- esc_attr( get_the_title() ),
162
- $thumb_width,
163
- $thumb_height
164
- );
165
- ?>
166
-
167
- <?php } // endif ?>
168
-
169
- <?php } // endif ?>
170
-
171
- <h3 class="rpwe-title">
172
- <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>
173
- </h3>
174
-
175
- <?php if ( $date == true ) { // Check if the date option enable. ?>
176
- <time class="rpwe-time published" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo get_the_date(); ?></time>
177
- <?php } // endif ?>
178
-
179
- <?php if ( $excerpt == true ) { // Check if the excerpt option enable. ?>
180
- <div class="rpwe-summary">
181
- <?php echo rpwe_excerpt( $length ); ?>
182
- <?php if ( $readmore == true ) { echo '<a href="' . esc_url( get_permalink() ) . '" class="more-link">' . $readmore_text . '</a>'; } ?>
183
- </div>
184
- <?php } // endif ?>
185
-
186
- </li>
187
-
188
- <?php endforeach; wp_reset_postdata(); ?>
189
-
190
- </ul>
191
-
192
- </div><!-- .rpwe-block - http://wordpress.org/plugins/recent-posts-widget-extended/ -->
193
-
194
- <?php
195
- } /* End check. */
196
-
197
- echo $after_widget;
198
-
199
- }
200
-
201
- /**
202
- * Updates the widget control options for the particular instance of the widget.
203
- *
204
- * @since 0.1
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
-
235
- }
236
-
237
- /**
238
- * Displays the widget control options in the Widgets admin screen.
239
- *
240
- * @since 0.1
241
- */
242
- function form( $instance ) {
243
-
244
- /* Output widget selector. */
245
- $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}";
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 &raquo;', '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'] ); ?> />&nbsp;
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'] ); ?> />&nbsp;<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 } ?>
404
- </select>
405
- </p>
406
-
407
- </div>
408
-
409
- <div class="rpwe-columns-3 rpwe-column-last">
410
-
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'] ); ?> />&nbsp;
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'] ); ?> />&nbsp;
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'] ); ?> />&nbsp;
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'] ); ?> />&nbsp;
476
- </p>
477
-
478
- </div>
479
-
480
- <div class="clear"></div>
481
-
482
- <?php
483
- }
484
-
485
- }
486
-
487
- /**
488
- * Print a custom excerpt.
489
- * Code revision in version 0.9, uses wp_trim_words function.
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;
501
- }
502
-
503
- /**
504
- * Custom Styles.
505
- *
506
- * @since 0.8
507
- * @access public
508
- */
509
- function rpwe_custom_styles() {
510
- ?>
511
- <style>
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/rpwe-fr_FR.mo ADDED
Binary file
languages/rpwe-fr_FR.po ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Recent Posts Widget Extended\n"
4
+ "POT-Creation-Date: 2014-04-11 12:32-0500\n"
5
+ "PO-Revision-Date: 2014-04-11 12:40-0500\n"
6
+ "Last-Translator: Matthieu Durocher <matthieu@technocyclope.com>\n"
7
+ "Language-Team: Matthieu Durocher <matthieu@technocyclope.com>\n"
8
+ "Language: fr_FR\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.6.4\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
16
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
17
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
18
+ "Plural-Forms: nplurals=2; plural=(n > 1);\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #: includes/widget-recent-posts-extended.php:19
22
+ msgid ""
23
+ "An advanced widget that gives you total control over the output of your "
24
+ "site’s most recent Posts."
25
+ msgstr ""
26
+ "Un widget de pointe qui vous donne un contrôle total sur l'affichage des "
27
+ "derniers billets de votre site."
28
+
29
+ #: includes/widget-recent-posts-extended.php:28
30
+ msgid "Recent Posts Extended"
31
+ msgstr "Recent Posts Extended"
32
+
33
+ #: includes/widget-recent-posts-extended.php:119
34
+ #: includes/widget-recent-posts-extended.php:159
35
+ #, php-format
36
+ msgid "Permalink to %s"
37
+ msgstr "Lien vers %s"
38
+
39
+ #: includes/widget-recent-posts-extended.php:251
40
+ msgid "Read More &raquo;"
41
+ msgstr "Lire la suite..."
42
+
43
+ #: includes/widget-recent-posts-extended.php:286
44
+ msgid "Title:"
45
+ msgstr "Titre :"
46
+
47
+ #: includes/widget-recent-posts-extended.php:290
48
+ msgid "Title URL:"
49
+ msgstr "Lien du titre :"
50
+
51
+ #: includes/widget-recent-posts-extended.php:294
52
+ msgid "CSS ID:"
53
+ msgstr "CSS ID :"
54
+
55
+ #: includes/widget-recent-posts-extended.php:298
56
+ msgid "Use Default Styles"
57
+ msgstr "Utilisez les styles par défaut"
58
+
59
+ #: includes/widget-recent-posts-extended.php:302
60
+ msgid "CSS:"
61
+ msgstr "CSS :"
62
+
63
+ #: includes/widget-recent-posts-extended.php:304
64
+ msgid "If you turn off the default styles, please create your own style."
65
+ msgstr ""
66
+ "Si vous désactivez les styles par défaut, s'il vous plaît créer votre propre "
67
+ "style."
68
+
69
+ #: includes/widget-recent-posts-extended.php:312
70
+ msgid "Limit:"
71
+ msgstr "Limite :"
72
+
73
+ #: includes/widget-recent-posts-extended.php:316
74
+ msgid "Offset (the number of posts to skip):"
75
+ msgstr "Décalage (le nombre de postes à sauter) :"
76
+
77
+ #: includes/widget-recent-posts-extended.php:320
78
+ msgid "Order:"
79
+ msgstr "Ordre :"
80
+
81
+ #: includes/widget-recent-posts-extended.php:322
82
+ msgid "DESC"
83
+ msgstr "DESC"
84
+
85
+ #: includes/widget-recent-posts-extended.php:323
86
+ msgid "ASC"
87
+ msgstr "ASC"
88
+
89
+ #: includes/widget-recent-posts-extended.php:327
90
+ msgid "Orderby:"
91
+ msgstr "Ordre par :"
92
+
93
+ #: includes/widget-recent-posts-extended.php:329
94
+ msgid "ID"
95
+ msgstr "ID"
96
+
97
+ #: includes/widget-recent-posts-extended.php:330
98
+ msgid "Author"
99
+ msgstr "Auteur"
100
+
101
+ #: includes/widget-recent-posts-extended.php:331
102
+ msgid "Title"
103
+ msgstr "Titre"
104
+
105
+ #: includes/widget-recent-posts-extended.php:332
106
+ msgid "Date"
107
+ msgstr "Date"
108
+
109
+ #: includes/widget-recent-posts-extended.php:333
110
+ msgid "Modified"
111
+ msgstr "Modifié"
112
+
113
+ #: includes/widget-recent-posts-extended.php:334
114
+ msgid "Random"
115
+ msgstr "Au hasard"
116
+
117
+ #: includes/widget-recent-posts-extended.php:335
118
+ msgid "Comment Count"
119
+ msgstr "Décompte des commentaires"
120
+
121
+ #: includes/widget-recent-posts-extended.php:336
122
+ msgid "Menu Order"
123
+ msgstr "Ordre du menu"
124
+
125
+ #: includes/widget-recent-posts-extended.php:340
126
+ msgid "Limit to Category: "
127
+ msgstr "Limiter à une catégorie :"
128
+
129
+ #: includes/widget-recent-posts-extended.php:351
130
+ msgid "Limit to Tag: "
131
+ msgstr "Limiter à un mot clé :"
132
+
133
+ #: includes/widget-recent-posts-extended.php:363
134
+ msgid "Choose the Post Type: "
135
+ msgstr "Choisir le type d'article :"
136
+
137
+ #: includes/widget-recent-posts-extended.php:379
138
+ msgid "Display Thumbnail"
139
+ msgstr "Affichage de la miniature"
140
+
141
+ #: includes/widget-recent-posts-extended.php:383
142
+ msgid "Thumbnail (height, width, align):"
143
+ msgstr "miniature (hauteur, largeur, alignement) :"
144
+
145
+ #: includes/widget-recent-posts-extended.php:387
146
+ msgid "Left"
147
+ msgstr "Gauche"
148
+
149
+ #: includes/widget-recent-posts-extended.php:388
150
+ msgid "Right"
151
+ msgstr "Droite"
152
+
153
+ #: includes/widget-recent-posts-extended.php:389
154
+ msgid "Center"
155
+ msgstr "Centre"
156
+
157
+ #: includes/widget-recent-posts-extended.php:393
158
+ msgid "Default Thumbnail:"
159
+ msgstr "Miniature par défaut :"
160
+
161
+ #: includes/widget-recent-posts-extended.php:395
162
+ msgid "Leave it blank to disable."
163
+ msgstr "Laissez ce champ vide pour désactiver."
164
+
165
+ #: includes/widget-recent-posts-extended.php:401
166
+ msgid "Display Excerpt"
167
+ msgstr "Affichage de l'extrait"
168
+
169
+ #: includes/widget-recent-posts-extended.php:405
170
+ msgid "Excerpt Length:"
171
+ msgstr "Longueur de l'extrait"
172
+
173
+ #: includes/widget-recent-posts-extended.php:409
174
+ msgid "Display Readmore"
175
+ msgstr "Affichage de «Lire la suite»"
176
+
177
+ #: includes/widget-recent-posts-extended.php:413
178
+ msgid "Readmore Text:"
179
+ msgstr "Texte «Lire la suite» :"
180
+
181
+ #: includes/widget-recent-posts-extended.php:417
182
+ msgid "Display Date"
183
+ msgstr "Affichage de la date"
184
+
185
+ #: includes/widget-recent-posts-extended.php:421
186
+ msgid "Date Format:"
187
+ msgstr "Format de date :"
188
+
189
+ #: includes/widget-recent-posts-extended.php:423
190
+ msgid ""
191
+ "<a href=\"http://codex.wordpress.org/Formatting_Date_and_Time\" target="
192
+ "\"_blank\">Date reference</a>"
193
+ msgstr ""
194
+ "<a href=\"http://codex.wordpress.org/Formatting_Date_and_Time\" target="
195
+ "\"_blank\">Référence pour les formats de date</a>"
readme.txt CHANGED
@@ -1,39 +1,50 @@
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
 
11
- Provides flexible and advanced recent posts widget. Allows you to display them with thumbnails, post excerpt, multiple category and more.
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.
25
  * Display from all, specific or multiple tag.
26
- * Display post date and you can set the format.
27
- * Default thumbnail.
28
  * Read more option.
29
  * Post type option.
30
- * Custom CSS
31
  * Multiple widgets.
32
- * Support [Get the Image](http://wordpress.org/plugins/get-the-image/) plugin.
33
 
34
- = Ugly Image Sizes =
 
 
 
35
 
36
- 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.
 
 
37
 
38
  = Tested Themes =
39
 
@@ -49,14 +60,21 @@ This plugin creates custom image sizes. If you use images that were uploaded to
49
 
50
  * Go to [forum support](http://wordpress.org/support/plugin/recent-posts-widget-extended).
51
  * [Rate/Review the plugin](http://wordpress.org/support/view/plugin-reviews/recent-posts-widget-extended).
 
52
 
53
  = Plugin Info =
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
 
@@ -82,7 +100,7 @@ This plugin creates custom image sizes. If you use images that were uploaded to
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 ) {
@@ -91,6 +109,9 @@ function your_custom_function( $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
 
@@ -100,27 +121,156 @@ Did you installed any Post or Post Type Order? Please try to deactivate it and t
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.
118
-
119
- = 0.9.1 - 4/22/2014 =
120
- * If you use caching plugin, please flush the cache after updating
121
- * Only load admin widget style on Widgets page
122
- * Replaced `get_the_excerpt()` with `get_the_content()` for the post excert. Props [Akbyte](http://profiles.wordpress.org/akbyte/)
123
- * Fix issue when no posts exist
124
- * Set `suppress_filters` to false to support WPML
125
- * Removed date format option. I have to removed it since some people need the date translatable, it will uses 'Date Format' on Settings > General panel.
126
- * Update language
1
  === Recent Posts Widget Extended ===
2
  Contributors: satrya, themejunkie
3
  Donate link: http://satrya.me/donate/
4
+ Tags: recent posts, random posts, popular posts, thumbnails, widget, widgets, sidebar, excerpt, category, post tag, taxonomy, post type, post status, shortcode, multiple widgets
5
  Requires at least: 3.6
6
+ Tested up to: 4.0
7
+ Stable tag: 0.9.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Provides flexible and advanced recent posts. Display it via shortcode or widget with with thumbnails, post excerpt, taxonomy and more.
12
 
13
  == Description ==
14
 
15
+ This plugin will enable a custom, flexible and super advanced recent posts, you can display it via shortcode or 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 taxonomy, post type and much more!
16
 
17
+ = New Features =
18
 
19
+ * WordPress 4.0 Support.
20
+ * Shortcode feature. Please read [Other Notes](http://wordpress.org/plugins/recent-posts-widget-extended/other_notes)
21
+ * Taxonomy support!
22
+ * Post status option.
23
+ * Custom html or text before and/or after recent posts.
24
+ * Added some filter to allow dev to customize the plugin. Please read [FAQ](http://wordpress.org/plugins/recent-posts-widget-extended/faq)
25
+
26
+ = Features Include =
27
+
28
+ * Allow you to set title url.
29
  * Display by date, comment count or random.
30
  * Display thumbnails, with customizable size and alignment.
31
  * Display excerpt, with customizable length.
32
  * Display from all, specific or multiple category.
33
  * Display from all, specific or multiple tag.
34
+ * Display post date.
 
35
  * Read more option.
36
  * Post type option.
37
+ * Custom CSS.
38
  * Multiple widgets.
 
39
 
40
+ = Plugin Support =
41
+
42
+ * [Get the Image](http://wordpress.org/plugins/get-the-image/).
43
+ * [Page Builder by SiteOrigin](http://wordpress.org/plugins/siteorigin-panels/).
44
 
45
+ = Image Sizes Issue =
46
+
47
+ 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 fix the image sizes.
48
 
49
  = Tested Themes =
50
 
60
 
61
  * Go to [forum support](http://wordpress.org/support/plugin/recent-posts-widget-extended).
62
  * [Rate/Review the plugin](http://wordpress.org/support/view/plugin-reviews/recent-posts-widget-extended).
63
+ * Submit translation.
64
 
65
  = Plugin Info =
66
  * Developed by [Satrya](http://satrya.me/) & [Theme Junkie](http://www.theme-junkie.com/)
67
  * Check out the [Github](https://github.com/satrya/recent-posts-widget-extended) repo to contribute.
68
 
69
+ = Posts Plugin Series =
70
+ * [Recent Posts Widget Extended](http://wordpress.org/plugins/recent-posts-widget-extended/)
71
+ * [Advanced Random Posts Widget](http://wordpress.org/plugins/advanced-random-posts-widget/)
72
+
73
  = Contributors =
74
  * [David Kryzaniak](http://profiles.wordpress.org/davidkryzaniak/)
75
  * [AKbyte](http://profiles.wordpress.org/akbyte/)
76
+ * [Alexander Sidorov](https://github.com/lkart)
77
+ * [Rubens Mariuzzo](https://github.com/rmariuzzo)
78
 
79
  == Installation ==
80
 
100
  == Frequently Asked Questions ==
101
 
102
  = How to filter the post query? =
103
+ You can use `rpwe_default_query_arguments` to filter it. Example:
104
  `
105
  add_filter( 'rpwe_default_query_arguments', 'your_custom_function' );
106
  function your_custom_function( $args ) {
109
  }
110
  `
111
 
112
+ = How to filter the post excerpt? =
113
+ Post excerpt now comes with filter to easily dev to change/customize it. `apply_filters( 'rpwe_excerpt', get_the_excerpt() )`
114
+
115
  = Thumbnail size option not working properly =
116
  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.
117
 
121
  = No image options =
122
  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.
123
 
124
+ = How to add custom style? =
125
+ First, please uncheck the **Use Default Style** option then place the css code below in the Custom CSS box, then you can customize it to fit your needs
126
+ `
127
+ .rpwe-block ul {
128
+ list-style: none !important;
129
+ margin-left: 0 !important;
130
+ padding-left: 0 !important;
131
+ }
132
+ .rpwe-block li {
133
+ border-bottom: 1px solid #eee;
134
+ margin-bottom: 10px;
135
+ padding-bottom: 10px;
136
+ list-style-type: none;
137
+ }
138
+ .rpwe-block a {
139
+ display: inline !important;
140
+ text-decoration: none;
141
+ }
142
+ .rpwe-block h3 {
143
+ background: none !important;
144
+ clear: none;
145
+ margin-bottom: 0 !important;
146
+ margin-top: 0 !important;
147
+ font-weight: 400;
148
+ font-size: 12px !important;
149
+ line-height: 1.5em;
150
+ }
151
+ .rpwe-thumb {
152
+ border: 1px solid #eee !important;
153
+ box-shadow: none !important;
154
+ margin: 2px 10px 2px 0;
155
+ padding: 3px !important;
156
+ }
157
+ .rpwe-summary {
158
+ font-size: 12px;
159
+ }
160
+ .rpwe-time {
161
+ color: #bbb;
162
+ font-size: 11px;
163
+ }
164
+ .rpwe-alignleft {
165
+ display: inline;
166
+ float: left;
167
+ }
168
+ .rpwe-alignright {
169
+ display: inline;
170
+ float: right;
171
+ }
172
+ .rpwe-aligncenter {
173
+ display: block;
174
+ margin-left: auto;
175
+ margin-right: auto;
176
+ }
177
+ .rpwe-clearfix:before,.rpwe-clearfix:after {
178
+ content: "";
179
+ display: table !important;
180
+ }
181
+ .rpwe-clearfix:after {
182
+ clear: both;
183
+ }
184
+ .rpwe-clearfix {
185
+ zoom: 1;
186
+ }
187
+ `
188
+
189
+ = Available filters =
190
+ Default arguments
191
+ `
192
+ rpwe_default_args
193
+ `
194
+
195
+ Post excerpt
196
+ `
197
+ rpwe_excerpt
198
+ `
199
+
200
+ Post markup
201
+ `
202
+ rpwe_markup
203
+ `
204
+
205
+ Post query arguments
206
+ `
207
+ rpwe_default_query_arguments
208
+ `
209
+
210
  == Screenshots ==
211
 
212
  1. The widget settings
213
 
214
+ == Shorcode Explanation ==
215
+
216
+ Explanation of shortcode options:
217
+
218
+ Basic shortcode
219
+ `
220
+ [rpwe]
221
+ `
222
+
223
+ Display 10 recent posts
224
+ `
225
+ [rpwe limit="10"]
226
+ `
227
+
228
+ Display 10 recent posts with thumbnail
229
+ `
230
+ [rpwe limit="10" thumb="true"]
231
+ `
232
+
233
+ **Here's the full default shortcode arguments**
234
+ `
235
+ limit="5"
236
+ offset=""
237
+ order="DESC"
238
+ orderby="date"
239
+ post_type="post"
240
+ cat=""
241
+ tag=""
242
+ taxonomy=""
243
+ post_type="post"
244
+ post_status="publish"
245
+ ignore_sticky="1"
246
+ taxonomy=""
247
+ excerpt="false"
248
+ length="10"
249
+ thumb="true"
250
+ thumb_height="45"
251
+ thumb_width="45"
252
+ thumb_default="http://placehold.it/45x45/f0f0f0/ccc"
253
+ thumb_align="rpwe-alignleft"
254
+ date="true"
255
+ readmore="false"
256
+ readmore_text="Read More &raquo;"
257
+ styles_default="true"
258
+ cssID=""
259
+ before=""
260
+ after=""
261
+ `
262
+
263
  == Changelog ==
264
 
265
+ = 0.9.4 - =
266
+ * Tested for WordPress 4.0.
267
+ * **The code is totally rewritten, please re-save or re-install the plugin if it doesn't work properly. I'm sorry for it.**
268
+ * After some research, I decided to get back the `get_the_excerpt()` as the excerpt. But now you can easily to change it via filter. Please read [FAQ](http://wordpress.org/plugins/recent-posts-widget-extended/faq)
269
+ * Added: Shortcode support.
270
+ * Added: Post status option.
271
+ * Added: Taxonomy input to limit the posts based on taxonomy.
272
+ * Added: Exclude sticky post.
273
+ * Added: You can display HTML or text before or after the posts.
274
+ * Added: Now support Siteorigin Page Builder.
275
+ * Removed: Suppres Filter option
276
+ * Limit to Category and Limit to Tag option will be removed in the next release, please just use the **Limit to Taxonomy** option to display posts based on taxonomy.
 
 
 
 
 
 
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.3
7
  * Author: Satrya
8
  * Author URI: http://satrya.me/
9
  * Author Email: satrya@satrya.me
@@ -52,6 +52,9 @@ class RPW_Extended {
52
  // Register widget.
53
  add_action( 'widgets_init', array( &$this, 'register_widget' ) );
54
 
 
 
 
55
  }
56
 
57
  /**
@@ -70,6 +73,9 @@ class RPW_Extended {
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
 
@@ -90,7 +96,9 @@ class RPW_Extended {
90
  * @since 0.1
91
  */
92
  public function includes() {
93
- require_once( RPWE_INCLUDES . 'widget-recent-posts-extended.php' );
 
 
94
  }
95
 
96
  /**
@@ -101,8 +109,9 @@ class RPW_Extended {
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 );
@@ -115,9 +124,19 @@ class RPW_Extended {
115
  * @since 0.9.1
116
  */
117
  public function register_widget() {
 
118
  register_widget( 'Recent_Posts_Widget_Extended' );
119
  }
120
 
 
 
 
 
 
 
 
 
 
121
  }
122
 
123
  new RPW_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.4
7
  * Author: Satrya
8
  * Author URI: http://satrya.me/
9
  * Author Email: satrya@satrya.me
52
  // Register widget.
53
  add_action( 'widgets_init', array( &$this, 'register_widget' ) );
54
 
55
+ // Register new image size.
56
+ add_action( 'init', array( &$this, 'register_image_size' ) );
57
+
58
  }
59
 
60
  /**
73
  // Set the constant path to the includes directory.
74
  define( 'RPWE_INCLUDES', RPWE_DIR . trailingslashit( 'includes' ) );
75
 
76
+ // Set the constant path to the includes directory.
77
+ define( 'RPWE_CLASS', RPWE_DIR . trailingslashit( 'classes' ) );
78
+
79
  // Set the constant path to the assets directory.
80
  define( 'RPWE_ASSETS', RPWE_URI . trailingslashit( 'assets' ) );
81
 
96
  * @since 0.1
97
  */
98
  public function includes() {
99
+ require_once( RPWE_INCLUDES . 'functions.php' );
100
+ require_once( RPWE_INCLUDES . 'shortcode.php' );
101
+ require_once( RPWE_INCLUDES . 'style.php' );
102
  }
103
 
104
  /**
109
  public function admin_style() {
110
 
111
  // Check if current screen is Widgets page.
112
+ if ( 'widgets' != get_current_screen()->base ) {
113
  return;
114
+ }
115
 
116
  // Loads the widget style.
117
  wp_enqueue_style( 'rpwe-admin-style', trailingslashit( RPWE_ASSETS ) . 'css/rpwe-admin.css', null, null );
124
  * @since 0.9.1
125
  */
126
  public function register_widget() {
127
+ require_once( RPWE_CLASS . 'widget.php' );
128
  register_widget( 'Recent_Posts_Widget_Extended' );
129
  }
130
 
131
+ /**
132
+ * Register new image size.
133
+ *
134
+ * @since 0.9.4
135
+ */
136
+ function register_image_size() {
137
+ add_image_size( 'rpwe-thumbnail', 45, 45, true );
138
+ }
139
+
140
  }
141
 
142
  new RPW_Extended;