Version Description
- Fixed category detection code, which created some messy bugs in some cases
Download this release
Release Info
Developer | fernandobt |
Plugin | List category posts |
Version | 0.20.3 |
Comparing to | |
See all releases |
Code changes from version 0.20.2 to 0.20.3
- include/CatList.php +7 -5
- list_cat_posts.php +3 -2
- readme.txt +15 -4
include/CatList.php
CHANGED
@@ -24,14 +24,16 @@ class CatList{
|
|
24 |
* Get the categories & posts
|
25 |
*/
|
26 |
private function lcp_set_categories(){
|
27 |
-
if(isset($this->params['
|
28 |
-
$this->lcp_category_id = $this->get_category_id_by_name($this->params['name']);
|
29 |
-
}elseif (isset($this->params['id']) && $this->params['id'] != '0'){
|
30 |
-
$this->lcp_category_id = $this->params['id'];
|
31 |
-
} else {
|
32 |
global $post;
|
33 |
$categories = get_the_category($post->ID);
|
34 |
$this->lcp_category_id = $categories[0]->cat_ID;
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
$args = array('cat'=> $this->lcp_category_id);
|
24 |
* Get the categories & posts
|
25 |
*/
|
26 |
private function lcp_set_categories(){
|
27 |
+
if ( isset($this->params['categorypage']) && $this->params['categorypage'] == 'yes' ){
|
|
|
|
|
|
|
|
|
28 |
global $post;
|
29 |
$categories = get_the_category($post->ID);
|
30 |
$this->lcp_category_id = $categories[0]->cat_ID;
|
31 |
+
} elseif ( isset($this->params['name']) && $this->params['name'] != '' ){
|
32 |
+
$this->lcp_category_id = $this->get_category_id_by_name($this->params['name']);
|
33 |
+
} elseif ( isset($this->params['id']) && $this->params['id'] != '0' ){
|
34 |
+
$this->lcp_category_id = $this->params['id'];
|
35 |
+
} else {
|
36 |
+
$this->lcp_category_id = 0;
|
37 |
}
|
38 |
|
39 |
$args = array('cat'=> $this->lcp_category_id);
|
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.20.
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://picandocodigo.net/
|
9 |
*/
|
@@ -61,7 +61,8 @@ class ListCategoryPosts{
|
|
61 |
'customfield_name' => '',
|
62 |
'customfield_value' =>'',
|
63 |
'customfield_display' =>'',
|
64 |
-
'taxonomy' => ''
|
|
|
65 |
), $atts);
|
66 |
|
67 |
$catlist_displayer = new CatListDisplayer($atts);
|
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.20.3
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://picandocodigo.net/
|
9 |
*/
|
61 |
'customfield_name' => '',
|
62 |
'customfield_value' =>'',
|
63 |
'customfield_display' =>'',
|
64 |
+
'taxonomy' => '',
|
65 |
+
'categorypage' => ''
|
66 |
), $atts);
|
67 |
|
68 |
$catlist_displayer = new CatListDisplayer($atts);
|
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.20.
|
8 |
|
9 |
== Description ==
|
10 |
List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.
|
@@ -44,11 +44,16 @@ If you've found the plugin useful, consider making a [donation via PayPal](http:
|
|
44 |
|
45 |
*Selecting the category*
|
46 |
|
47 |
-
The plugin can figure out the category from which you want to list posts in three different ways: Using the *category id*, the *category slug* and *detecting the current post's category*.
|
|
|
|
|
|
|
48 |
|
49 |
* **name** - To display posts from a category using the category's name. Ex: [catlist name=mycategory]
|
50 |
|
51 |
-
* **id** - To display posts from a category using the category's id. Ex: [catlist id=24]. You can **include several categories**: Ex: [catlist id=17,24,32] or **exclude** a category with the minus (-)
|
|
|
|
|
52 |
|
53 |
*Other parameters*
|
54 |
|
@@ -107,7 +112,7 @@ The plugin can figure out the category from which you want to list posts in thre
|
|
107 |
|
108 |
* **custom fields** - To use custom fields, you must specify two values: customfield_name and customfield_value. Using this only show posts that contain a custom field with this name and value. Both parameters must be defined, or neither will work.
|
109 |
|
110 |
-
* **customfield_display** - Display custom field(s). You can specify many fields to show, separating them with a coma.
|
111 |
|
112 |
* **template** - File name of template from templates directory without extension. Example: For 'template.php' value is only 'template'. Default is 'default', which displays an unordered list (ul html tag) with a CSS class. This class can be passed as a parameter or by default it's: 'lcp_catlist'. You can also use the default 'div' value. This will output a div with the 'lcp_catlist' CSS class (or one you pass as parameter with the class argument). The inner items (posts) will be displayed between p tags.
|
113 |
|
@@ -161,6 +166,12 @@ Template system has changed. Custom templates should be stored in WordPress them
|
|
161 |
|
162 |
== Changelog ==
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
= 0.20.1 =
|
165 |
* Fixed extra " added to ul tag, thanks ideric (http://wordpress.org/support/topic/plugin-list-category-posts-extra-added-to-ul-tag)
|
166 |
|
4 |
Tags: list, categories, posts, cms
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.2.1
|
7 |
+
Stable tag: 0.20.3
|
8 |
|
9 |
== Description ==
|
10 |
List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.
|
44 |
|
45 |
*Selecting the category*
|
46 |
|
47 |
+
The plugin can figure out the category from which you want to list posts in three different ways: Using the *category id*, the *category slug* and *detecting the current post's category*.
|
48 |
+
When using List Category Posts inside a post, if you don't pass the category id or slug, it will post the latest posts from every category.
|
49 |
+
You can use the *categorypage* parameter to make it detect the category id of the current posts, and list posts from that category.
|
50 |
+
The parameters for choosing the category id are:
|
51 |
|
52 |
* **name** - To display posts from a category using the category's name. Ex: [catlist name=mycategory]
|
53 |
|
54 |
+
* **id** - To display posts from a category using the category's id. Ex: [catlist id=24]. You can **include several categories**: Ex: [catlist id=17,24,32] or **exclude** a category with the minus (-)
|
55 |
+
|
56 |
+
* **categorypage** - Set it to "yes" if you want to list the posts from the current post's category.
|
57 |
|
58 |
*Other parameters*
|
59 |
|
112 |
|
113 |
* **custom fields** - To use custom fields, you must specify two values: customfield_name and customfield_value. Using this only show posts that contain a custom field with this name and value. Both parameters must be defined, or neither will work.
|
114 |
|
115 |
+
* **customfield_display** - Display custom field(s). You can specify many fields to show, separating them with a coma.
|
116 |
|
117 |
* **template** - File name of template from templates directory without extension. Example: For 'template.php' value is only 'template'. Default is 'default', which displays an unordered list (ul html tag) with a CSS class. This class can be passed as a parameter or by default it's: 'lcp_catlist'. You can also use the default 'div' value. This will output a div with the 'lcp_catlist' CSS class (or one you pass as parameter with the class argument). The inner items (posts) will be displayed between p tags.
|
118 |
|
166 |
|
167 |
== Changelog ==
|
168 |
|
169 |
+
= 0.20.3 =
|
170 |
+
* Fixed category detection code, which created some messy bugs in some cases
|
171 |
+
|
172 |
+
= 0.20.2 =
|
173 |
+
* Minor bugfix release
|
174 |
+
|
175 |
= 0.20.1 =
|
176 |
* Fixed extra " added to ul tag, thanks ideric (http://wordpress.org/support/topic/plugin-list-category-posts-extra-added-to-ul-tag)
|
177 |
|