WP-Paginate - Version 2.0.4

Version Description

  • Removed trailing slash from pagination links
Download this release

Release Info

Developer AlanP57
Plugin Icon 128x128 WP-Paginate
Version 2.0.4
Comparing to
See all releases

Code changes from version 2.0.3 to 2.0.4

Files changed (2) hide show
  1. readme.txt +5 -2
  2. wp-paginate.php +6 -6
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: maxfoundry, emartin24, AlanP57
3
  Tags: paginate, pagination, navigation, page, wp-paginate, comments, rtl, seo, usability
4
  Requires at least: 2.6.0 (2.7.0 for comments pagination)
5
- Tested up to: 4.9
6
- Stable tag: 2.0.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -159,6 +159,9 @@ Example (also applies to `wp_paginate_comments()`):
159
  When calling `wp_paginate_comments()`, WP-Paginate adds an extra class to the `ol` element, `wp-paginate-comments`.
160
 
161
  == Changelog ==
 
 
 
162
  = 2.0.3 =
163
  * Added neon pink button style
164
 
2
  Contributors: maxfoundry, emartin24, AlanP57
3
  Tags: paginate, pagination, navigation, page, wp-paginate, comments, rtl, seo, usability
4
  Requires at least: 2.6.0 (2.7.0 for comments pagination)
5
+ Tested up to: 4.9.5
6
+ Stable tag: 2.0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
159
  When calling `wp_paginate_comments()`, WP-Paginate adds an extra class to the `ol` element, `wp-paginate-comments`.
160
 
161
  == Changelog ==
162
+ = 2.0.4 =
163
+ * Removed trailing slash from pagination links
164
+
165
  = 2.0.3 =
166
  * Added neon pink button style
167
 
wp-paginate.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Paginate
4
  Plugin URI: https://wordpress.org/plugins/wp-paginate/
5
  Description: A simple and flexible pagination plugin for WordPress posts and comments.
6
- Version: 2.0.3
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: 'wp-paginate'
@@ -60,7 +60,7 @@ if (!class_exists('WPPaginate')) {
60
  /**
61
  * @var string The plugin version
62
  */
63
- public $version = '2.0.3';
64
 
65
  /**
66
  * @var string The options string name for this plugin
@@ -329,12 +329,12 @@ if (!class_exists('WPPaginate')) {
329
  }
330
 
331
  $prevlink = ($this->type === 'posts')
332
- ? esc_url(get_pagenum_link($page - 1))
333
  : get_comments_pagenum_link($page - 1);
334
  $nextlink = ($this->type === 'posts')
335
- ? esc_url(get_pagenum_link($page + 1))
336
  : get_comments_pagenum_link($page + 1);
337
-
338
  $output = stripslashes(wp_kses_decode_entities($before));
339
  if ($pages > 1) {
340
 
@@ -403,7 +403,7 @@ if (!class_exists('WPPaginate')) {
403
  function paginate_loop($start, $max, $page = 0) {
404
  $output = "";
405
  for ($i = $start; $i <= $max; $i++) {
406
- $p = ($this->type === 'posts') ? esc_url(get_pagenum_link($i)) : get_comments_pagenum_link($i);
407
  $output .= ($page == intval($i))
408
  ? "<li><span class='page current'>$i</span></li>"
409
  : "<li><a href='$p' title='$i' class='page'>$i</a></li>";
3
  Plugin Name: WP-Paginate
4
  Plugin URI: https://wordpress.org/plugins/wp-paginate/
5
  Description: A simple and flexible pagination plugin for WordPress posts and comments.
6
+ Version: 2.0.4
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: 'wp-paginate'
60
  /**
61
  * @var string The plugin version
62
  */
63
+ public $version = '2.0.4';
64
 
65
  /**
66
  * @var string The options string name for this plugin
329
  }
330
 
331
  $prevlink = ($this->type === 'posts')
332
+ ? rtrim(esc_url(get_pagenum_link($page - 1)), '/')
333
  : get_comments_pagenum_link($page - 1);
334
  $nextlink = ($this->type === 'posts')
335
+ ? rtrim(esc_url(get_pagenum_link($page + 1)), '/')
336
  : get_comments_pagenum_link($page + 1);
337
+
338
  $output = stripslashes(wp_kses_decode_entities($before));
339
  if ($pages > 1) {
340
 
403
  function paginate_loop($start, $max, $page = 0) {
404
  $output = "";
405
  for ($i = $start; $i <= $max; $i++) {
406
+ $p = ($this->type === 'posts') ? rtrim(esc_url(get_pagenum_link($i)), '/') : get_comments_pagenum_link($i);
407
  $output .= ($page == intval($i))
408
  ? "<li><span class='page current'>$i</span></li>"
409
  : "<li><a href='$p' title='$i' class='page'>$i</a></li>";