List category posts - Version 0.21.1

Version Description

= 0.18 = Template system was upgraded with new options. Backwards compatible, but you can better customize the way the post contents are displayed. Check templates/default.php.

= 0.17 = Upgrade your templates: Templates system was rewritten, so your current templates will probably not work. Check out the new default.php file on /templates to see the simpler new way to work with templates.

= 0.13.2 = Thumbnail parameter 'thumbnails' changed to 'thumbnail.

= 0.7.2 = Template system has changed. Now the posts loop must be defined inside the template. Check templates/default.php for an example.

= 0.8 = Widget built for WordPress 2.8's Widget API, so you need at least WP 2.8 to use the widget.

= 0.9 = Template system has changed. Custom templates should be stored in WordPress theme folder.

Download this release

Release Info

Developer fernandobt
Plugin Icon 128x128 List category posts
Version 0.21.1
Comparing to
See all releases

Code changes from version 0.21 to 0.21.1

Files changed (3) hide show
  1. include/CatList.php +12 -8
  2. list_cat_posts.php +1 -1
  3. readme.txt +1 -1
include/CatList.php CHANGED
@@ -31,16 +31,18 @@ class CatList{
31
  'numberposts' => $this->params['numberposts'],
32
  'orderby' => $this->params['orderby'],
33
  'order' => $this->params['order'],
34
- 'exclude' => $this->params['excludeposts'],
35
  'offset' => $this->params['offset']
36
  ));
37
-
 
 
 
38
  // Post type and post parent:
39
- if(isset($this->params['post_type'])): $args['post_type'] = $this->params['post_type']; endif;
40
- if(isset($this->params['post_parent'])): $args['post_parent'] = $this->params['post_parent']; endif;
41
 
42
  // Custom fields 'customfield_name' & 'customfield_value' should both be defined
43
- if(isset($this->params['customfield_name']) && $this->params['customfield_value'] != ''):
44
  $args['meta_key'] = $this->params['customfield_name'];
45
  $args['meta_value'] = $this->params['customfield_value'];
46
  endif;
@@ -51,15 +53,17 @@ class CatList{
51
  }
52
 
53
  // Added custom taxonomy support
54
- if (isset($this->params['taxonomy']) && $this->params['taxonomy'] != '' && $this->params['tags'] != "") {
55
  $args['tax_query'] = array(array(
56
  'taxonomy' => $this->params['taxonomy'],
57
  'field' => 'slug',
58
  'terms' => explode(",",$this->params['tags'])
59
  ));
60
- } else if (isset($this->params['tags'])) {
61
  $args['tag'] = $this->params['tags'];
62
  }
 
 
63
  $this->lcp_categories_posts = get_posts($args);
64
  }
65
 
@@ -69,7 +73,7 @@ class CatList{
69
  global $post;
70
  $categories = get_the_category($post->ID);
71
  $this->lcp_category_id = $categories[0]->cat_ID;
72
- } elseif ( isset($this->params['name']) && $this->params['name'] != '' ){
73
  if (preg_match('/,/', $this->params['name'])){
74
  $categories = '';
75
  $cat_array = explode(",", $this->params['name']);
31
  'numberposts' => $this->params['numberposts'],
32
  'orderby' => $this->params['orderby'],
33
  'order' => $this->params['order'],
 
34
  'offset' => $this->params['offset']
35
  ));
36
+
37
+ //Exclude
38
+ if(isset($this->params['excludeposts']) && $this->params['excludeposts'] != '0'): $args['exclude'] = $this->params['excludeposts']; endif;
39
+
40
  // Post type and post parent:
41
+ if(isset($this->params['post_type']) && $this->params['post_type'] != '0'): $args['post_type'] = $this->params['post_type']; endif;
42
+ if(isset($this->params['post_parent']) && $this->params['post_parent'] != '0'): $args['post_parent'] = $this->params['post_parent']; endif;
43
 
44
  // Custom fields 'customfield_name' & 'customfield_value' should both be defined
45
+ if( !empty($this->params['customfield_value']) ):
46
  $args['meta_key'] = $this->params['customfield_name'];
47
  $args['meta_value'] = $this->params['customfield_value'];
48
  endif;
53
  }
54
 
55
  // Added custom taxonomy support
56
+ if ( !empty($this->params['taxonomy']) && !empty($this->params['tags']) ) {
57
  $args['tax_query'] = array(array(
58
  'taxonomy' => $this->params['taxonomy'],
59
  'field' => 'slug',
60
  'terms' => explode(",",$this->params['tags'])
61
  ));
62
+ } else if ( !empty($this->params['tags']) ) {
63
  $args['tag'] = $this->params['tags'];
64
  }
65
+
66
+ var_dump($args);
67
  $this->lcp_categories_posts = get_posts($args);
68
  }
69
 
73
  global $post;
74
  $categories = get_the_category($post->ID);
75
  $this->lcp_category_id = $categories[0]->cat_ID;
76
+ } elseif ( !empty($this->params['name']) ){
77
  if (preg_match('/,/', $this->params['name'])){
78
  $categories = '';
79
  $cat_array = explode(",", $this->params['name']);
list_cat_posts.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: List category posts
4
  Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
5
  Description: List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, and the number of posts to display. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
- Version: 0.21
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
  */
3
  Plugin Name: List category posts
4
  Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
5
  Description: List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, and the number of posts to display. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
+ Version: 0.21.1
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
  */
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts
4
  Tags: list, categories, posts, cms
5
  Requires at least: 2.8
6
  Tested up to: 3.2.1
7
- Stable tag: 0.21
8
 
9
  == Description ==
10
  List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.
4
  Tags: list, categories, posts, cms
5
  Requires at least: 2.8
6
  Tested up to: 3.2.1
7
+ Stable tag: 0.21.1
8
 
9
  == Description ==
10
  List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.