Skip to content

Commit

Permalink
Added small fix for category id
Browse files Browse the repository at this point in the history
git-svn-id: http://plugins.svn.wordpress.org/list-category-posts/trunk@345801 b8457f37-d9ea-0310-8a92-e5e31aec5664
  • Loading branch information
fernandobt committed Feb 15, 2011
1 parent 6082325 commit 7f23094
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion include/CatList.php
Expand Up @@ -56,8 +56,14 @@ private function lcp_set_categories(){
* by Eric Celeste / http://eric.clst.org
*/
private function get_category_id_by_name($cat_name){
//We check if the name gets the category id, if not, we check the slug.
$term = get_term_by('name', $cat_name, 'category');

if (!$term):
$term = get_term_by('name', $cat_name, 'category');
return $term->term_id;
endif;

return $term->term_id;
}

public function get_category_id(){
Expand Down
2 changes: 1 addition & 1 deletion list_cat_posts.php
Expand Up @@ -3,7 +3,7 @@
Plugin Name: List category posts
Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
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].
Version: 0.18
Version: 0.18.1
Author: Fernando Briano
Author URI: http://picandocodigo.net/
*/
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Expand Up @@ -4,7 +4,7 @@ Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts
Tags: list, categories, posts, cms
Requires at least: 2.8
Tested up to: 3.1
Stable tag: 0.18
Stable tag: 0.18.1

== Description ==
List Category Posts is a simple WordPress plugin which 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.
Expand Down Expand Up @@ -137,6 +137,9 @@ Template system has changed. Custom templates should be stored in WordPress them

== Changelog ==

= 0.18.1 =
* Added slug and name to the fetching of category id from previous update.

= 0.18 =
* Fixed category id bug. Reported and fixed by Eric Celeste / http://eric.clst.org, thanks!
* Improved template system a liitle bit, now you can pass an HTML tag and a CSS class to sorround each field on your template.
Expand Down

0 comments on commit 7f23094

Please sign in to comment.