Version Description
- Added option to add trailing slash to pagination links when needed
Download this release
Release Info
Developer | AlanP57 |
Plugin | WP-Paginate |
Version | 2.0.5 |
Comparing to | |
See all releases |
Code changes from version 2.0.4 to 2.0.5
- I18n/readme.txt +0 -0
- I18n/wp-paginate.mo +0 -0
- I18n/wp-paginate.pot +0 -0
- css/wp-paginate-admin.css +0 -0
- css/wp-paginate-rtl.css +0 -0
- css/wp-paginate.css +0 -0
- images/MBP.png +0 -0
- images/MG_logo.png +0 -0
- images/MLPP-card-red.png +0 -0
- images/blue-cta-buttons.jpg +0 -0
- images/buy-now-btn.png +0 -0
- images/default.jpg +0 -0
- images/max-foundry.png +0 -0
- images/modern-grey-buttons.jpg +0 -0
- images/neon-pink-buttons.png +0 -0
- images/screenshot-2.png +0 -0
- images/wp-paginate-logo.png +0 -0
- images/wpp-pro-logo-2.png +0 -0
- images/wppp-buttons.png +0 -0
- images/wppp-customizer.png +0 -0
- js/wp-paginate.js +0 -0
- lib/codemirror.css +0 -0
- lib/codemirror.js +0 -0
- license.txt +0 -0
- readme.txt +5 -2
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- wp-paginate.php +47 -16
I18n/readme.txt
CHANGED
File without changes
|
I18n/wp-paginate.mo
CHANGED
File without changes
|
I18n/wp-paginate.pot
CHANGED
File without changes
|
css/wp-paginate-admin.css
CHANGED
File without changes
|
css/wp-paginate-rtl.css
CHANGED
File without changes
|
css/wp-paginate.css
CHANGED
File without changes
|
images/MBP.png
CHANGED
File without changes
|
images/MG_logo.png
CHANGED
File without changes
|
images/MLPP-card-red.png
CHANGED
File without changes
|
images/blue-cta-buttons.jpg
CHANGED
File without changes
|
images/buy-now-btn.png
CHANGED
File without changes
|
images/default.jpg
CHANGED
File without changes
|
images/max-foundry.png
CHANGED
File without changes
|
images/modern-grey-buttons.jpg
CHANGED
File without changes
|
images/neon-pink-buttons.png
CHANGED
File without changes
|
images/screenshot-2.png
CHANGED
File without changes
|
images/wp-paginate-logo.png
CHANGED
File without changes
|
images/wpp-pro-logo-2.png
CHANGED
File without changes
|
images/wppp-buttons.png
CHANGED
File without changes
|
images/wppp-customizer.png
CHANGED
File without changes
|
js/wp-paginate.js
CHANGED
File without changes
|
lib/codemirror.css
CHANGED
File without changes
|
lib/codemirror.js
CHANGED
File without changes
|
license.txt
CHANGED
File without changes
|
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.
|
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.4 =
|
163 |
* Removed trailing slash from pagination links
|
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.8
|
6 |
+
Stable tag: 2.0.5
|
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.5 =
|
163 |
+
* Added option to add trailing slash to pagination links when needed
|
164 |
+
|
165 |
= 2.0.4 =
|
166 |
* Removed trailing slash from pagination links
|
167 |
|
screenshot-1.png
CHANGED
File without changes
|
screenshot-2.png
CHANGED
File without changes
|
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.
|
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.
|
64 |
|
65 |
/**
|
66 |
* @var string The options string name for this plugin
|
@@ -93,7 +93,7 @@ if (!class_exists('WPPaginate')) {
|
|
93 |
public $fonts = array();
|
94 |
|
95 |
public $presets = array();
|
96 |
-
|
97 |
/**
|
98 |
* Constructor
|
99 |
*/
|
@@ -308,7 +308,12 @@ if (!class_exists('WPPaginate')) {
|
|
308 |
$after_option = $this->options['after'];
|
309 |
else
|
310 |
$after_option = '</div>';
|
311 |
-
|
|
|
|
|
|
|
|
|
|
|
312 |
$before = stripslashes(html_entity_decode($before_option));
|
313 |
$after = stripslashes(html_entity_decode($after_option));
|
314 |
|
@@ -334,6 +339,11 @@ if (!class_exists('WPPaginate')) {
|
|
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) {
|
@@ -349,6 +359,9 @@ if (!class_exists('WPPaginate')) {
|
|
349 |
$ellipsis = "<li><span class='gap'>...</span></li>";
|
350 |
|
351 |
if ($page > 1 && !empty($previouspage)) {
|
|
|
|
|
|
|
352 |
$output .= sprintf('<li><a href="%s" class="prev">%s</a></li>', $prevlink, stripslashes($previouspage));
|
353 |
}
|
354 |
|
@@ -360,32 +373,35 @@ if (!class_exists('WPPaginate')) {
|
|
360 |
|
361 |
if ($left_gap && !$right_gap) {
|
362 |
$output .= sprintf('%s%s%s',
|
363 |
-
$this->paginate_loop(1, $anchor),
|
364 |
$ellipsis,
|
365 |
-
$this->paginate_loop($block_min, $pages, $page)
|
366 |
);
|
367 |
}
|
368 |
else if ($left_gap && $right_gap) {
|
369 |
$output .= sprintf('%s%s%s%s%s',
|
370 |
-
$this->paginate_loop(1, $anchor),
|
371 |
$ellipsis,
|
372 |
-
$this->paginate_loop($block_min, $block_high, $page),
|
373 |
$ellipsis,
|
374 |
-
$this->paginate_loop(($pages - $anchor + 1), $pages)
|
375 |
);
|
376 |
}
|
377 |
else if ($right_gap && !$left_gap) {
|
378 |
$output .= sprintf('%s%s%s',
|
379 |
-
$this->paginate_loop(1, $block_high, $page),
|
380 |
$ellipsis,
|
381 |
-
$this->paginate_loop(($pages - $anchor + 1), $pages)
|
382 |
);
|
383 |
}
|
384 |
else {
|
385 |
-
$output .= $this->paginate_loop(1, $pages, $page);
|
386 |
}
|
387 |
|
388 |
if ($page < $pages && !empty($nextpage)) {
|
|
|
|
|
|
|
389 |
$output .= sprintf('<li><a href="%s" class="next">%s</a></li>', $nextlink, stripslashes($nextpage));
|
390 |
}
|
391 |
$output .= "</ol>";
|
@@ -400,13 +416,16 @@ if (!class_exists('WPPaginate')) {
|
|
400 |
/**
|
401 |
* Helper function for pagination which builds the page links.
|
402 |
*/
|
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 |
-
|
408 |
-
|
409 |
-
|
410 |
}
|
411 |
return $output;
|
412 |
}
|
@@ -448,6 +467,7 @@ if (!class_exists('WPPaginate')) {
|
|
448 |
'nextpage' => '»',
|
449 |
'previouspage' => '«',
|
450 |
'css' => true,
|
|
|
451 |
'before' => '<div class="navigation">',
|
452 |
'after' => '</div>',
|
453 |
'empty' => true,
|
@@ -518,6 +538,7 @@ if (!class_exists('WPPaginate')) {
|
|
518 |
$this->options['after'] = esc_attr($_POST['after']);
|
519 |
$this->options['empty'] = (isset($_POST['empty']) && $_POST['empty'] === 'on') ? true : false;
|
520 |
$this->options['css'] = (isset($_POST['css']) && $_POST['css'] === 'on') ? true : false;
|
|
|
521 |
$this->options['range'] = intval($_POST['range']);
|
522 |
$this->options['anchor'] = intval($_POST['anchor']);
|
523 |
$this->options['gap'] = intval($_POST['gap']);
|
@@ -771,6 +792,16 @@ if (!class_exists('WPPaginate')) {
|
|
771 |
<td><label for="css">
|
772 |
<input type="checkbox" id="css" name="css" <?php echo ($this->options['css'] === true) ? "checked='checked'" : ""; ?>/> <?php printf(__('Include the default stylesheet wp-paginate.css? WP-Paginate will first look for <code>wp-paginate.css</code> in your theme directory (<code>themes/%s</code>).', 'wp-paginate'), get_template()); ?></label></td>
|
773 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
774 |
<tr valign="top">
|
775 |
<th scope="row"><?php _e('Page Range:', 'wp-paginate'); ?></th>
|
776 |
<td>
|
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.5
|
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.5';
|
64 |
|
65 |
/**
|
66 |
* @var string The options string name for this plugin
|
93 |
public $fonts = array();
|
94 |
|
95 |
public $presets = array();
|
96 |
+
|
97 |
/**
|
98 |
* Constructor
|
99 |
*/
|
308 |
$after_option = $this->options['after'];
|
309 |
else
|
310 |
$after_option = '</div>';
|
311 |
+
|
312 |
+
if(isset($this->options['slash']))
|
313 |
+
$slash_option = $this->options['slash'];
|
314 |
+
else
|
315 |
+
$slash_option = false;
|
316 |
+
|
317 |
$before = stripslashes(html_entity_decode($before_option));
|
318 |
$after = stripslashes(html_entity_decode($after_option));
|
319 |
|
339 |
$nextlink = ($this->type === 'posts')
|
340 |
? rtrim(esc_url(get_pagenum_link($page + 1)), '/')
|
341 |
: get_comments_pagenum_link($page + 1);
|
342 |
+
|
343 |
+
if($slash_option == true) {
|
344 |
+
$prevlink . '/';
|
345 |
+
$nextlink . '/';
|
346 |
+
}
|
347 |
|
348 |
$output = stripslashes(wp_kses_decode_entities($before));
|
349 |
if ($pages > 1) {
|
359 |
$ellipsis = "<li><span class='gap'>...</span></li>";
|
360 |
|
361 |
if ($page > 1 && !empty($previouspage)) {
|
362 |
+
if($slash_option)
|
363 |
+
$output .= sprintf('<li><a href="%s/" class="prev">%s</a></li>', $prevlink, stripslashes($previouspage));
|
364 |
+
else
|
365 |
$output .= sprintf('<li><a href="%s" class="prev">%s</a></li>', $prevlink, stripslashes($previouspage));
|
366 |
}
|
367 |
|
373 |
|
374 |
if ($left_gap && !$right_gap) {
|
375 |
$output .= sprintf('%s%s%s',
|
376 |
+
$this->paginate_loop(1, $anchor, 0, $slash_option),
|
377 |
$ellipsis,
|
378 |
+
$this->paginate_loop($block_min, $pages, $page, $slash_option)
|
379 |
);
|
380 |
}
|
381 |
else if ($left_gap && $right_gap) {
|
382 |
$output .= sprintf('%s%s%s%s%s',
|
383 |
+
$this->paginate_loop(1, $anchor, 0, $slash_option),
|
384 |
$ellipsis,
|
385 |
+
$this->paginate_loop($block_min, $block_high, $page, $slash_option),
|
386 |
$ellipsis,
|
387 |
+
$this->paginate_loop(($pages - $anchor + 1), $pages, 0, $slash_option)
|
388 |
);
|
389 |
}
|
390 |
else if ($right_gap && !$left_gap) {
|
391 |
$output .= sprintf('%s%s%s',
|
392 |
+
$this->paginate_loop(1, $block_high, $page, $slash_option),
|
393 |
$ellipsis,
|
394 |
+
$this->paginate_loop(($pages - $anchor + 1), $pages, 0, $slash_option)
|
395 |
);
|
396 |
}
|
397 |
else {
|
398 |
+
$output .= $this->paginate_loop(1, $pages, $page, $slash_option);
|
399 |
}
|
400 |
|
401 |
if ($page < $pages && !empty($nextpage)) {
|
402 |
+
if($slash_option)
|
403 |
+
$output .= sprintf('<li><a href="%s/" class="next">%s</a></li>', $nextlink, stripslashes($nextpage));
|
404 |
+
else
|
405 |
$output .= sprintf('<li><a href="%s" class="next">%s</a></li>', $nextlink, stripslashes($nextpage));
|
406 |
}
|
407 |
$output .= "</ol>";
|
416 |
/**
|
417 |
* Helper function for pagination which builds the page links.
|
418 |
*/
|
419 |
+
function paginate_loop($start, $max, $page = 0, $slash = false) {
|
420 |
$output = "";
|
421 |
for ($i = $start; $i <= $max; $i++) {
|
422 |
+
if($slash)
|
423 |
+
$p = ($this->type === 'posts') ? esc_url(get_pagenum_link($i)) : get_comments_pagenum_link($i);
|
424 |
+
else
|
425 |
$p = ($this->type === 'posts') ? rtrim(esc_url(get_pagenum_link($i)), '/') : get_comments_pagenum_link($i);
|
426 |
+
$output .= ($page == intval($i))
|
427 |
+
? "<li><span class='page current'>$i</span></li>"
|
428 |
+
: "<li><a href='$p' title='$i' class='page'>$i</a></li>";
|
429 |
}
|
430 |
return $output;
|
431 |
}
|
467 |
'nextpage' => '»',
|
468 |
'previouspage' => '«',
|
469 |
'css' => true,
|
470 |
+
'slash' => false,
|
471 |
'before' => '<div class="navigation">',
|
472 |
'after' => '</div>',
|
473 |
'empty' => true,
|
538 |
$this->options['after'] = esc_attr($_POST['after']);
|
539 |
$this->options['empty'] = (isset($_POST['empty']) && $_POST['empty'] === 'on') ? true : false;
|
540 |
$this->options['css'] = (isset($_POST['css']) && $_POST['css'] === 'on') ? true : false;
|
541 |
+
$this->options['slash'] = (isset($_POST['slash']) && $_POST['slash'] === 'on') ? true : false;
|
542 |
$this->options['range'] = intval($_POST['range']);
|
543 |
$this->options['anchor'] = intval($_POST['anchor']);
|
544 |
$this->options['gap'] = intval($_POST['gap']);
|
792 |
<td><label for="css">
|
793 |
<input type="checkbox" id="css" name="css" <?php echo ($this->options['css'] === true) ? "checked='checked'" : ""; ?>/> <?php printf(__('Include the default stylesheet wp-paginate.css? WP-Paginate will first look for <code>wp-paginate.css</code> in your theme directory (<code>themes/%s</code>).', 'wp-paginate'), get_template()); ?></label></td>
|
794 |
</tr>
|
795 |
+
<?php
|
796 |
+
if(!isset($this->options['slash']))
|
797 |
+
$this->options['slash'] = false;
|
798 |
+
?>
|
799 |
+
<tr valign="top">
|
800 |
+
<th scope="row"><?php _e('Add trailing slash:', 'wp-paginate'); ?></th>
|
801 |
+
<td><label for="slash">
|
802 |
+
<input type="checkbox" id="css" name="slash" <?php echo ($this->options['slash'] === true) ? "checked='checked'" : ""; ?>/> <?php printf(__('Adds a trailing slash to the end of pagination links.', 'wp-paginate'), get_template()); ?></label></td>
|
803 |
+
</tr>
|
804 |
+
|
805 |
<tr valign="top">
|
806 |
<th scope="row"><?php _e('Page Range:', 'wp-paginate'); ?></th>
|
807 |
<td>
|