Category Posts Widget - Version 4.1.2

Version Description

  • Please consider to re-configure the widget as the latest version has numerous changes from previous.
  • Version 4.0 uses CSS file for styling the widget in front end.
  • Version 3.0 or later version uses WordPress 2.9's built in post thumbnail functionality.
Download this release

Release Info

Developer Kometschuh
Plugin Icon 128x128 Category Posts Widget
Version 4.1.2
Comparing to
See all releases

Code changes from version 4.1.1 to 4.1.2

Files changed (3) hide show
  1. cat-posts.css +1 -1
  2. cat-posts.php +8 -12
  3. readme.txt +12 -3
cat-posts.css CHANGED
@@ -1,6 +1,6 @@
1
  /*
2
  Default CSS Styles for the Category Posts Widget plugin
3
- Version: 4.1.1
4
  */
5
  .cat-post-current,
6
  .cat-post-date,
1
  /*
2
  Default CSS Styles for the Category Posts Widget plugin
3
+ Version: 4.1.2
4
  */
5
  .cat-post-current,
6
  .cat-post-date,
cat-posts.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Category Posts Widget
4
  Plugin URI: http://mkrdip.me/category-posts-widget
5
  Description: Adds a widget that shows the most recent posts from a single category.
6
  Author: Mrinal Kanti Roy
7
- Version: 4.1.1
8
  Author URI: http://mkrdip.me
9
  */
10
 
@@ -50,8 +50,7 @@ class CategoryPosts extends WP_Widget {
50
 
51
  function __construct() {
52
  $widget_ops = array('classname' => 'cat-post-widget', 'description' => __('List single category posts'));
53
- $control_ops = array( 'show_title' => true );
54
- parent::__construct('category-posts', __('Category Posts'), $widget_ops, $control_ops);
55
  }
56
 
57
  // Displays category posts widget on blog.
@@ -95,7 +94,7 @@ class CategoryPosts extends WP_Widget {
95
  echo $before_widget;
96
 
97
  // Widget title
98
- if( isset ( $instance["show_title"] ) && $instance["show_title"] ) {
99
  echo $before_title;
100
  if( isset ( $instance["title_link"] ) ) {
101
  echo '<a href="' . get_category_link($instance["cat"]) . '">' . $instance["title"] . '</a>';
@@ -193,9 +192,6 @@ class CategoryPosts extends WP_Widget {
193
  $sizes[$this->id] = array($new_instance['thumb_w'], $new_instance['thumb_h']);
194
  update_option('mkrdip_cat_post_thumb_sizes', $sizes);
195
 
196
- // show title
197
- $new_instance['show_title'] = $new_instance['show_title'];
198
-
199
  return $new_instance;
200
  }
201
 
@@ -208,7 +204,7 @@ class CategoryPosts extends WP_Widget {
208
  function form($instance) {
209
  $instance = wp_parse_args( ( array ) $instance, array(
210
  'title' => __( '' ),
211
- 'show_title' => __( true ),
212
  'cat' => __( '' ),
213
  'num' => __( '' ),
214
  'sort_by' => __( '' ),
@@ -226,7 +222,7 @@ class CategoryPosts extends WP_Widget {
226
  ) );
227
 
228
  $title = $instance['title'];
229
- $show_title = $instance['show_title'];
230
  $cat = $instance['cat'];
231
  $num = $instance['num'];
232
  $sort_by = $instance['sort_by'];
@@ -250,9 +246,9 @@ class CategoryPosts extends WP_Widget {
250
  </label>
251
  </p>
252
  <p>
253
- <label for="<?php echo $this->get_field_id("show_title"); ?>">
254
- <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("show_title"); ?>" name="<?php echo $this->get_field_name("show_title"); ?>"<?php checked( (bool) $instance["show_title"], true ); ?> />
255
- <?php _e( 'Show title' ); ?>
256
  </label>
257
  </p>
258
  <p>
4
  Plugin URI: http://mkrdip.me/category-posts-widget
5
  Description: Adds a widget that shows the most recent posts from a single category.
6
  Author: Mrinal Kanti Roy
7
+ Version: 4.1.2
8
  Author URI: http://mkrdip.me
9
  */
10
 
50
 
51
  function __construct() {
52
  $widget_ops = array('classname' => 'cat-post-widget', 'description' => __('List single category posts'));
53
+ parent::__construct('category-posts', __('Category Posts'), $widget_ops);
 
54
  }
55
 
56
  // Displays category posts widget on blog.
94
  echo $before_widget;
95
 
96
  // Widget title
97
+ if( !isset ( $instance["hide_title"] ) ) {
98
  echo $before_title;
99
  if( isset ( $instance["title_link"] ) ) {
100
  echo '<a href="' . get_category_link($instance["cat"]) . '">' . $instance["title"] . '</a>';
192
  $sizes[$this->id] = array($new_instance['thumb_w'], $new_instance['thumb_h']);
193
  update_option('mkrdip_cat_post_thumb_sizes', $sizes);
194
 
 
 
 
195
  return $new_instance;
196
  }
197
 
204
  function form($instance) {
205
  $instance = wp_parse_args( ( array ) $instance, array(
206
  'title' => __( '' ),
207
+ 'hide_title' => __( '' ),
208
  'cat' => __( '' ),
209
  'num' => __( '' ),
210
  'sort_by' => __( '' ),
222
  ) );
223
 
224
  $title = $instance['title'];
225
+ $hide_title = $instance['hide_title'];
226
  $cat = $instance['cat'];
227
  $num = $instance['num'];
228
  $sort_by = $instance['sort_by'];
246
  </label>
247
  </p>
248
  <p>
249
+ <label for="<?php echo $this->get_field_id("hide_title"); ?>">
250
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("hide_title"); ?>" name="<?php echo $this->get_field_name("hide_title"); ?>"<?php checked( (bool) $instance["hide_title"], true ); ?> />
251
+ <?php _e( 'Hide title' ); ?>
252
  </label>
253
  </p>
254
  <p>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://mkrdip.me/donate
4
  Tags: category, posts, widget, single category widget, posts widget, category recent posts
5
  Requires at least: 2.8
6
  Tested up to: 4.3.0
7
- Stable tag: 4.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -25,7 +25,7 @@ Category Posts Widget is a light widget designed to do one thing and do it well:
25
  * Option to show the post date.
26
  * Option to show the comment count.
27
  * Option to make the widget title link to the category page.
28
- * Option to show/hide the title
29
  * Multiple widgets.
30
 
31
  = Contribute =
@@ -57,6 +57,11 @@ Automatic installation is the easiest option as WordPress handles the file trans
57
  * Version 4.0 uses CSS file for styling the widget in front end.
58
  * Version 3.0 or later version uses WordPress 2.9's built in post thumbnail functionality.
59
 
 
 
 
 
 
60
 
61
  == Screenshots ==
62
 
@@ -65,10 +70,14 @@ Automatic installation is the easiest option as WordPress handles the file trans
65
 
66
  == Changelog ==
67
 
 
 
 
 
68
  4.1.1
69
 
70
  * Added option to put thumbnail on top
71
- * Added option to show/hide the title
72
  * Fixed no background bug.
73
 
74
  4.1.0
4
  Tags: category, posts, widget, single category widget, posts widget, category recent posts
5
  Requires at least: 2.8
6
  Tested up to: 4.3.0
7
+ Stable tag: 4.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
25
  * Option to show the post date.
26
  * Option to show the comment count.
27
  * Option to make the widget title link to the category page.
28
+ * Option to hide the title
29
  * Multiple widgets.
30
 
31
  = Contribute =
57
  * Version 4.0 uses CSS file for styling the widget in front end.
58
  * Version 3.0 or later version uses WordPress 2.9's built in post thumbnail functionality.
59
 
60
+ == Frequently Asked Questions ==
61
+
62
+ = The font-size is different from that of other widgets? =
63
+
64
+ Please use the option: "Disable widget CSS".
65
 
66
  == Screenshots ==
67
 
70
 
71
  == Changelog ==
72
 
73
+ 4.1.2
74
+
75
+ * Fixed hide title bug.
76
+
77
  4.1.1
78
 
79
  * Added option to put thumbnail on top
80
+ * Added option to hide the title
81
  * Fixed no background bug.
82
 
83
  4.1.0