Category Posts Widget - Version 3.3

Version Description

Note that version 3.0 drops support for Simple Post Thumbnails plugin in favor of WP 2.9's built in post thumbnail functionality.

Download this release

Release Info

Developer ZephyrWest
Plugin Icon 128x128 Category Posts Widget
Version 3.3
Comparing to
See all releases

Code changes from version 3.2 to 3.3

Files changed (2) hide show
  1. cat-posts.php +3 -3
  2. readme.txt +6 -1
cat-posts.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Category Posts Widget
4
  Plugin URI: http://jameslao.com/2011/03/24/category-posts-widget-3-2/
5
  Description: Adds a widget that can display posts from a single category.
6
  Author: James Lao
7
- Version: 3.2
8
  Author URI: http://jameslao.com/
9
  */
10
 
@@ -42,7 +42,7 @@ function widget($args, $instance) {
42
  $instance["title"] = $category_info->name;
43
  }
44
 
45
- $valid_sort_orders = array('date', 'title', 'comment_count', 'random');
46
  if ( in_array($instance['sort_by'], $valid_sort_orders) ) {
47
  $sort_by = $instance['sort_by'];
48
  $sort_order = (bool) $instance['asc_sort_order'] ? 'ASC' : 'DESC';
@@ -180,7 +180,7 @@ function form($instance) {
180
  <option value="date"<?php selected( $instance["sort_by"], "date" ); ?>>Date</option>
181
  <option value="title"<?php selected( $instance["sort_by"], "title" ); ?>>Title</option>
182
  <option value="comment_count"<?php selected( $instance["sort_by"], "comment_count" ); ?>>Number of comments</option>
183
- <option value="random"<?php selected( $instance["sort_by"], "random" ); ?>>Random</option>
184
  </select>
185
  </label>
186
  </p>
4
  Plugin URI: http://jameslao.com/2011/03/24/category-posts-widget-3-2/
5
  Description: Adds a widget that can display posts from a single category.
6
  Author: James Lao
7
+ Version: 3.3
8
  Author URI: http://jameslao.com/
9
  */
10
 
42
  $instance["title"] = $category_info->name;
43
  }
44
 
45
+ $valid_sort_orders = array('date', 'title', 'comment_count', 'rand');
46
  if ( in_array($instance['sort_by'], $valid_sort_orders) ) {
47
  $sort_by = $instance['sort_by'];
48
  $sort_order = (bool) $instance['asc_sort_order'] ? 'ASC' : 'DESC';
180
  <option value="date"<?php selected( $instance["sort_by"], "date" ); ?>>Date</option>
181
  <option value="title"<?php selected( $instance["sort_by"], "title" ); ?>>Title</option>
182
  <option value="comment_count"<?php selected( $instance["sort_by"], "comment_count" ); ?>>Number of comments</option>
183
+ <option value="rand"<?php selected( $instance["sort_by"], "rand" ); ?>>Random</option>
184
  </select>
185
  </label>
186
  </p>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://jameslao.com/
4
  Tags: category, posts, widget
5
  Requires at least: 2.8
6
  Tested up to: 3.1
7
- Stable tag: 3.2
8
 
9
  Adds a widget that shows the most recent posts in a single category.
10
 
@@ -41,7 +41,12 @@ Note that version 3.0 drops support for [Simple Post Thumbnails plugin](http://w
41
 
42
  == Changelog ==
43
 
 
 
 
 
44
  3.2
 
45
  * Added option to change ordering of posts. Defaults to showing newest posts first.
46
 
47
  3.1
4
  Tags: category, posts, widget
5
  Requires at least: 2.8
6
  Tested up to: 3.1
7
+ Stable tag: 3.3
8
 
9
  Adds a widget that shows the most recent posts in a single category.
10
 
41
 
42
  == Changelog ==
43
 
44
+ 3.3
45
+
46
+ * Fixed random sort bug.
47
+
48
  3.2
49
+
50
  * Added option to change ordering of posts. Defaults to showing newest posts first.
51
 
52
  3.1