Version Description
- Fixed catlink to display titles for all the categories when using more than one category.
Download this release
Release Info
Developer | fernandobt |
Plugin | List category posts |
Version | 0.36.1 |
Comparing to | |
See all releases |
Code changes from version 0.36 to 0.36.1
- include/CatList.php +14 -7
- list_cat_posts.php +1 -1
- readme.txt +6 -2
include/CatList.php
CHANGED
@@ -23,8 +23,6 @@ class CatList{
|
|
23 |
$this->set_lcp_parameters();
|
24 |
}
|
25 |
|
26 |
-
|
27 |
-
|
28 |
/**
|
29 |
* Order the parameters and query the DB for posts
|
30 |
*/
|
@@ -228,11 +226,20 @@ class CatList{
|
|
228 |
*/
|
229 |
public function get_category_link(){
|
230 |
if($this->params['catlink'] == 'yes' && $this->lcp_category_id != 0):
|
231 |
-
$
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
else:
|
237 |
return null;
|
238 |
endif;
|
23 |
$this->set_lcp_parameters();
|
24 |
}
|
25 |
|
|
|
|
|
26 |
/**
|
27 |
* Order the parameters and query the DB for posts
|
28 |
*/
|
226 |
*/
|
227 |
public function get_category_link(){
|
228 |
if($this->params['catlink'] == 'yes' && $this->lcp_category_id != 0):
|
229 |
+
$ids = is_array($this->lcp_category_id) ?
|
230 |
+
$this->lcp_category_id :
|
231 |
+
explode(",", $this->lcp_category_id);
|
232 |
+
|
233 |
+
$link = array();
|
234 |
+
foreach($ids as $lcp_id){
|
235 |
+
$cat_link = get_category_link($lcp_id);
|
236 |
+
$cat_title = get_cat_name($lcp_id);
|
237 |
+
array_push($link, '<a href="' . $cat_link . '" title="' . $cat_title . '">' .
|
238 |
+
($this->lcp_not_empty('catlink_string') ? $this->params['catlink_string'] : $cat_title) .
|
239 |
+
$this->get_category_count() . '</a>');
|
240 |
+
}
|
241 |
+
|
242 |
+
return implode(", ", $link);
|
243 |
else:
|
244 |
return null;
|
245 |
endif;
|
list_cat_posts.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: List category posts
|
4 |
Plugin URI: https://github.com/picandocodigo/List-Category-Posts
|
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.36
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://picandocodigo.net/
|
9 |
|
3 |
Plugin Name: List category posts
|
4 |
Plugin URI: https://github.com/picandocodigo/List-Category-Posts
|
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.36.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: 3.3
|
6 |
Tested up to: 3.7.1
|
7 |
-
Stable tag: 0.36
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -71,7 +71,7 @@ When using List Category Posts whithout a category id, name or slug, it will pos
|
|
71 |
==Using several categories==
|
72 |
|
73 |
* **include** posts from several categories with **AND** relationship, posts that belong to all of the listed categories (note this does not show posts from any children of these categories): `[catlist id=17+25+2]` - `[catlist name=sega+nintendo]`.
|
74 |
-
* **include** posts from several categories with **OR** relationship, posts that belong to
|
75 |
* **exclude** a category with the minus sign (-): `[catlist id=11,-32,16]`, `[catlist id=1+2-3]`. **Important**: When using the *and* relationship, the order must be categories you want to include first, and exclude after. So `[catlist id=1+2-3]` will work, but `[catlist id=1+2-3+4]` won't.
|
76 |
|
77 |
|
@@ -274,6 +274,10 @@ Template system has changed. Custom templates should be stored in WordPress them
|
|
274 |
|
275 |
== Changelog ==
|
276 |
|
|
|
|
|
|
|
|
|
277 |
= 0.36 =
|
278 |
|
279 |
* Adds option for "target=_blank" for post links.
|
4 |
Tags: list, categories, posts, cms
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.7.1
|
7 |
+
Stable tag: 0.36.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
71 |
==Using several categories==
|
72 |
|
73 |
* **include** posts from several categories with **AND** relationship, posts that belong to all of the listed categories (note this does not show posts from any children of these categories): `[catlist id=17+25+2]` - `[catlist name=sega+nintendo]`.
|
74 |
+
* **include** posts from several categories with **OR** relationship, posts that belong to any of the listed categories: `[catlist id=17,24,32]` - `[catlist name=sega,nintendo]`.
|
75 |
* **exclude** a category with the minus sign (-): `[catlist id=11,-32,16]`, `[catlist id=1+2-3]`. **Important**: When using the *and* relationship, the order must be categories you want to include first, and exclude after. So `[catlist id=1+2-3]` will work, but `[catlist id=1+2-3+4]` won't.
|
76 |
|
77 |
|
274 |
|
275 |
== Changelog ==
|
276 |
|
277 |
+
= 0.36.1 =
|
278 |
+
|
279 |
+
* Fixed catlink to display titles for all the categories when using more than one category.
|
280 |
+
|
281 |
= 0.36 =
|
282 |
|
283 |
* Adds option for "target=_blank" for post links.
|