List category posts - Version 0.81

Version Description

  • Adds "" to the "..." in pagination.
  • Adds 'current_user' as an option to the author_posts parameter to list posts from logged in user.
Download this release

Release Info

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

Code changes from version 0.80.3 to 0.81

include/lcp-paginator.php CHANGED
@@ -35,6 +35,7 @@ class LcpPaginator {
35
  $pag_output = '';
36
  $this->prev_page_num = null;
37
  $this->next_page_num = null;
 
38
  if ( $pages_count > 1 ) {
39
  /* Dynamic pagination inspired by
40
  * https://gist.github.com/shlomohass/9869e138a4fba0e7dc4c
@@ -50,7 +51,7 @@ class LcpPaginator {
50
  // before and after current page.
51
  $pad = intval( $params['padding'] );
52
  // Print opening ellipsis if needed
53
- $params['page'] - $pad > 2 && $lcp_paginator .= '...';
54
  // Loop over pages excluding first and last page.
55
  for( $i = 2; $i < $pages_count; $i++ ) {
56
  if ( $i >= $params['page'] - $pad && $i <= $params['page'] + $pad ) {
@@ -63,7 +64,7 @@ class LcpPaginator {
63
  }
64
  }
65
  // Print closing ellipsis if needed
66
- $params['page'] + $pad < $pages_count - 1 && $lcp_paginator .= '...';
67
  // Print last page.
68
  $lcp_paginator .= $this->lcp_page_link(
69
  $pages_count,
35
  $pag_output = '';
36
  $this->prev_page_num = null;
37
  $this->next_page_num = null;
38
+ $lcp_elipsis = "<span class='lcp_elipsis'>...</span>";
39
  if ( $pages_count > 1 ) {
40
  /* Dynamic pagination inspired by
41
  * https://gist.github.com/shlomohass/9869e138a4fba0e7dc4c
51
  // before and after current page.
52
  $pad = intval( $params['padding'] );
53
  // Print opening ellipsis if needed
54
+ $params['page'] - $pad > 2 && $lcp_paginator .= $lcp_elipsis;
55
  // Loop over pages excluding first and last page.
56
  for( $i = 2; $i < $pages_count; $i++ ) {
57
  if ( $i >= $params['page'] - $pad && $i <= $params['page'] + $pad ) {
64
  }
65
  }
66
  // Print closing ellipsis if needed
67
+ $params['page'] + $pad < $pages_count - 1 && $lcp_paginator .= $lcp_elipsis;
68
  // Print last page.
69
  $lcp_paginator .= $this->lcp_page_link(
70
  $pages_count,
include/lcp-parameters.php CHANGED
@@ -51,7 +51,11 @@ class LcpParameters{
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)
51
  endif;
52
 
53
  if($this->utils->lcp_not_empty('author_posts')):
54
+ if ($params['author_posts'] == 'current_user'){
55
+ $args['author'] = wp_get_current_user()->ID;
56
+ } else {
57
+ $args['author_name'] = $params['author_posts'];
58
+ }
59
  endif;
60
  // Parameters which need to be checked simply, if they exist, add them to
61
  // final return array ($args)
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.80.3
7
  Author: Fernando Briano
8
  Author URI: http://fernandobriano.com
9
 
@@ -212,7 +212,6 @@ function lcp_pagination_css(){
212
 
213
  /**
214
  * TO-DO:
215
- - Pagination * DONE - Need to add "page" text
216
  - Add Older Posts at bottom of List Category Post page
217
  - Simpler template system
218
  - Exclude child categories
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.81
7
  Author: Fernando Briano
8
  Author URI: http://fernandobriano.com
9
 
212
 
213
  /**
214
  * TO-DO:
 
215
  - Add Older Posts at bottom of List Category Post page
216
  - Simpler template system
217
  - Exclude child categories
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: fernandobt
3
  Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support
4
  Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
- Tested up to: 5.2
7
  Requires PHP: 5.4
8
- Stable tag: 0.80.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -229,6 +229,11 @@ Template system has changed. Custom templates should be stored in WordPress them
229
 
230
  == Changelog ==
231
 
 
 
 
 
 
232
  = 0.80.3 =
233
 
234
  * Hopefully final bugfix from alt in thumbnails 🤦🏻
3
  Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support
4
  Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
+ Tested up to: 5.2.2
7
  Requires PHP: 5.4
8
+ Stable tag: 0.81
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
229
 
230
  == Changelog ==
231
 
232
+ = 0.81 =
233
+
234
+ * Adds "<span class='lcp_elipsis'>" to the "..." in pagination.
235
+ * Adds 'current_user' as an option to the author_posts parameter to list posts from logged in user.
236
+
237
  = 0.80.3 =
238
 
239
  * Hopefully final bugfix from alt in thumbnails 🤦🏻