List category posts - Version 0.49.1

Version Description

  • Makes sure "starting_with" queries are case insesitive.
    • Fixes category link on 'catlink' and 'catname' parameters (were showing twice)
Download this release

Release Info

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

Code changes from version 0.49 to 0.49.1

Files changed (3) hide show
  1. include/CatList.php +12 -5
  2. list_cat_posts.php +1 -1
  3. readme.txt +8 -1
include/CatList.php CHANGED
@@ -148,7 +148,8 @@ class CatList{
148
 
149
  public function starting_with($where){
150
  $letter = $this->params['starting_with'];
151
- $where .= ' AND wp_posts.post_title LIKE \'' . $letter . "%'";
 
152
  return $where;
153
  }
154
 
@@ -318,7 +319,6 @@ class CatList{
318
  public function get_category_link(){
319
  if( ($this->params['catlink'] == 'yes' || $this->params['catname'] == 'yes') &&
320
  $this->lcp_category_id != 0):
321
-
322
  // Check for one id or several:
323
  $ids = null;
324
  if (is_array($this->lcp_category_id)){
@@ -328,19 +328,26 @@ class CatList{
328
  }
329
 
330
  $link = array();
 
331
  foreach($ids as $lcp_id){
332
  $cat_link = get_category_link($lcp_id);
333
  $cat_title = get_cat_name($lcp_id);
334
- $cat_string = ($this->lcp_not_empty('catlink_string') ? $this->params['catlink_string'] : $cat_title);
335
 
 
 
 
 
 
 
 
 
336
  if ($this->params['catlink'] == 'yes'){
337
- $cat_string .= '<a href="' . $cat_link . '" title="' . $cat_title . '">' .
338
  $cat_string .
339
  $this->get_category_count($lcp_id) . '</a>';
340
  }
341
  array_push($link, $cat_string);
342
  }
343
-
344
  return implode(", ", $link);
345
  else:
346
  return null;
148
 
149
  public function starting_with($where){
150
  $letter = $this->params['starting_with'];
151
+ $where .= ' AND wp_posts.post_title ' .
152
+ 'COLLATE UTF8_GENERAL_CI LIKE \'' . $letter . "%'";
153
  return $where;
154
  }
155
 
319
  public function get_category_link(){
320
  if( ($this->params['catlink'] == 'yes' || $this->params['catname'] == 'yes') &&
321
  $this->lcp_category_id != 0):
 
322
  // Check for one id or several:
323
  $ids = null;
324
  if (is_array($this->lcp_category_id)){
328
  }
329
 
330
  $link = array();
331
+ // Loop on several categories:
332
  foreach($ids as $lcp_id){
333
  $cat_link = get_category_link($lcp_id);
334
  $cat_title = get_cat_name($lcp_id);
 
335
 
336
+ // Use the category title or 'catlink_string' set by user:
337
+ if ($this->lcp_not_empty('catlink_string')){
338
+ $cat_string = $this->params['catlink_string'];
339
+ } else {
340
+ $cat_string = $cat_title;
341
+ }
342
+
343
+ // Do we want the link or just the title?
344
  if ($this->params['catlink'] == 'yes'){
345
+ $cat_string = '<a href="' . $cat_link . '" title="' . $cat_title . '">' .
346
  $cat_string .
347
  $this->get_category_count($lcp_id) . '</a>';
348
  }
349
  array_push($link, $cat_string);
350
  }
 
351
  return implode(", ", $link);
352
  else:
353
  return null;
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.49
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.49.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.9.1
7
- Stable tag: 0.49
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -31,6 +31,8 @@ plugin at the moment. But new options will be implemented on demand.
31
 
32
  **[Please read the instructions](http://wordpress.org/extend/plugins/list-category-posts/other_notes/)** to learn what parameters are available and how to use them.
33
 
 
 
34
  You can find **Frequently Asked Questions** [here](https://github.com/picandocodigo/List-Category-Posts/blob/master/doc/FAQ.md#frequently-asked-questions).
35
 
36
  **Customization**
@@ -419,6 +421,11 @@ Template system has changed. Custom templates should be stored in WordPress them
419
 
420
  == Changelog ==
421
 
 
 
 
 
 
422
  = 0.49 =
423
 
424
  * Adds `author_posts_link`, to show an author's page.
4
  Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
  Tested up to: 3.9.1
7
+ Stable tag: 0.49.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
31
 
32
  **[Please read the instructions](http://wordpress.org/extend/plugins/list-category-posts/other_notes/)** to learn what parameters are available and how to use them.
33
 
34
+ If you want to **List Categories** instead of posts you can use my other plugin **[List categories](http://wordpress.org/plugins/list-categories/)**.
35
+
36
  You can find **Frequently Asked Questions** [here](https://github.com/picandocodigo/List-Category-Posts/blob/master/doc/FAQ.md#frequently-asked-questions).
37
 
38
  **Customization**
421
 
422
  == Changelog ==
423
 
424
+ = 0.49.1 =
425
+
426
+ * Makes sure "starting_with" queries are case insesitive.
427
+ * Fixes category link on 'catlink' and 'catname' parameters (were showing twice)
428
+
429
  = 0.49 =
430
 
431
  * Adds `author_posts_link`, to show an author's page.