List category posts - Version 0.53

Version Description

  • Adds "starting_with" parameter by Diego Sorribas. Thank you!
Download this release

Release Info

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

Code changes from version 0.52 to 0.53

Files changed (3) hide show
  1. include/lcp-catlist.php +9 -4
  2. list_cat_posts.php +1 -1
  3. readme.txt +8 -1
include/lcp-catlist.php CHANGED
@@ -149,10 +149,15 @@ class CatList{
149
  remove_all_filters('posts_where');
150
  }
151
 
152
- public function starting_with($where){
153
- $letter = $this->params['starting_with'];
154
- $where .= ' AND wp_posts.post_title ' .
155
- 'COLLATE UTF8_GENERAL_CI LIKE \'' . $letter . "%'";
 
 
 
 
 
156
  return $where;
157
  }
158
 
149
  remove_all_filters('posts_where');
150
  }
151
 
152
+ public function starting_with($where){
153
+ $letters = explode(',', $this->params['starting_with']);
154
+ $where .= 'AND (wp_posts.post_title ' .
155
+ 'COLLATE UTF8_GENERAL_CI LIKE \'' . $letters[0] . "%'";
156
+ for ($i=1; $i <sizeof($letters); $i++) {
157
+ $where .= 'OR wp_posts.post_title ' .
158
+ 'COLLATE UTF8_GENERAL_CI LIKE \'' . $letters[$i] . "%'";
159
+ }
160
+ $where.=')';
161
  return $where;
162
  }
163
 
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 by category in 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, the number of posts to display and many more parameters. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
- Version: 0.52
7
  Author: Fernando Briano
8
  Author URI: http://fernandobriano.com
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 by category in 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, the number of posts to display and many more parameters. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
+ Version: 0.53
7
  Author: Fernando Briano
8
  Author URI: http://fernandobriano.com
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: 4.1
7
- Stable tag: 0.52
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -132,6 +132,10 @@ update the plugin.
132
 
133
  ==Other parameters==
134
 
 
 
 
 
135
  * **author_posts** - Get posts by author. Use 'user_nicename' (NOT
136
  name). Example: `[catlist author_posts="fernando"]`
137
 
@@ -422,6 +426,9 @@ Template system has changed. Custom templates should be stored in WordPress them
422
 
423
  == Changelog ==
424
 
 
 
 
425
  = 0.52 =
426
  * Small fix for pagination and query string.
427
  * Fix on multiple categories with AND relationship.
4
  Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
  Tested up to: 4.1
7
+ Stable tag: 0.53
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
132
 
133
  ==Other parameters==
134
 
135
+ * **starting_with** - Get posts starting with a given letter. You can
136
+ use several letters. Example: `[catlist starting_with="m,o,t"]` will
137
+ list posts whose title start with either m, o or t.
138
+
139
  * **author_posts** - Get posts by author. Use 'user_nicename' (NOT
140
  name). Example: `[catlist author_posts="fernando"]`
141
 
426
 
427
  == Changelog ==
428
 
429
+ = 0.53 =
430
+ * Adds "starting_with" parameter by Diego Sorribas. Thank you!
431
+
432
  = 0.52 =
433
  * Small fix for pagination and query string.
434
  * Fix on multiple categories with AND relationship.