List category posts - Version 0.75.2

Version Description

  • Fix author_post and search parameters.
  • Multiple instances pagination fix.
  • New test for the LcpPaginator class.
Download this release

Release Info

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

Code changes from version 0.75.1 to 0.75.2

include/lcp-paginator.php CHANGED
@@ -44,6 +44,8 @@ class LcpPaginator {
44
  max( array( 1, $params['numberposts'] ) )
45
  );
46
  $pag_output = '';
 
 
47
  if ($pages_count > 1){
48
  for($i = 1; $i <= $pages_count; $i++){
49
  $lcp_paginator .= $this->lcp_page_link($i, $params['page'], $params['instance']);
44
  max( array( 1, $params['numberposts'] ) )
45
  );
46
  $pag_output = '';
47
+ $this->prev_page_num = null;
48
+ $this->next_page_num = null;
49
  if ($pages_count > 1){
50
  for($i = 1; $i <= $pages_count; $i++){
51
  $lcp_paginator .= $this->lcp_page_link($i, $params['page'], $params['instance']);
include/lcp-parameters.php CHANGED
@@ -46,6 +46,13 @@ class LcpParameters{
46
  // Check type, status, parent params
47
  $args = $this->lcp_types_and_statuses($args);
48
 
 
 
 
 
 
 
 
49
  // Parameters which need to be checked simply, if they exist, add them to
50
  // final return array ($args)
51
  $args = $this->lcp_check_basic_params($args);
@@ -178,7 +185,7 @@ class LcpParameters{
178
  );
179
  $args['orderby'] = 'orderby_clause';
180
  }
181
-
182
  // If either select_clause or orderby_clause were added to $meta_query,
183
  // it needs to be added to args.
184
  if ( !empty($meta_query) ) {
@@ -195,7 +202,7 @@ class LcpParameters{
195
  }
196
 
197
  private function lcp_check_basic_params($args){
198
- $simple_args = array('year', 'monthnum', 'search', 'author_posts', 'after');
199
  foreach($simple_args as $key){
200
  if($this->utils->lcp_not_empty($key)){
201
  $args[$key] = $this->params[$key];
46
  // Check type, status, parent params
47
  $args = $this->lcp_types_and_statuses($args);
48
 
49
+ if($this->utils->lcp_not_empty('search')):
50
+ $args['s'] = $params['search'];
51
+ endif;
52
+
53
+ if($this->utils->lcp_not_empty('author_posts')):
54
+ $args['author_name'] = $params['author_posts'];
55
+ endif;
56
  // Parameters which need to be checked simply, if they exist, add them to
57
  // final return array ($args)
58
  $args = $this->lcp_check_basic_params($args);
185
  );
186
  $args['orderby'] = 'orderby_clause';
187
  }
188
+
189
  // If either select_clause or orderby_clause were added to $meta_query,
190
  // it needs to be added to args.
191
  if ( !empty($meta_query) ) {
202
  }
203
 
204
  private function lcp_check_basic_params($args){
205
+ $simple_args = array('year', 'monthnum', 'after');
206
  foreach($simple_args as $key){
207
  if($this->utils->lcp_not_empty($key)){
208
  $args[$key] = $this->params[$key];
list-category-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.75.1
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.75.2
7
  Author: Fernando Briano
8
  Author URI: http://fernandobriano.com
9
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
  Tested up to: 4.9
7
  Requires PHP: 5.2.4
8
- Stable tag: 0.75.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -440,6 +440,12 @@ Template system has changed. Custom templates should be stored in WordPress them
440
 
441
  == Changelog ==
442
 
 
 
 
 
 
 
443
  = 0.75.1 =
444
 
445
  * Fix a case where pagination would show up but the CSS wasn't being loaded.
5
  Requires at least: 3.3
6
  Tested up to: 4.9
7
  Requires PHP: 5.2.4
8
+ Stable tag: 0.75.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
440
 
441
  == Changelog ==
442
 
443
+ = 0.75.2 =
444
+
445
+ * Fix `author_post` and `search` parameters.
446
+ * Multiple instances pagination fix.
447
+ * New test for the LcpPaginator class.
448
+
449
  = 0.75.1 =
450
 
451
  * Fix a case where pagination would show up but the CSS wasn't being loaded.