WP-Paginate - Version 2.1.6

Version Description

  • Improved accessibility by adding aria-label attributes
Download this release

Release Info

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

Code changes from version 2.1.5 to 2.1.6

Files changed (2) hide show
  1. readme.txt +4 -1
  2. wp-paginate.php +17 -16
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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: 5.7
6
- Stable tag: 2.1.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -161,6 +161,9 @@ Example (also applies to `wp_paginate_comments()`):
161
  When calling `wp_paginate_comments()`, WP-Paginate adds an extra class to the `ol` element, `wp-paginate-comments`.
162
 
163
  == Changelog ==
 
 
 
164
  = 2.1.5 =
165
  * Updated jQuery function calls
166
  * Replaced old color picker with newer version
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: 5.7
6
+ Stable tag: 2.1.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
161
  When calling `wp_paginate_comments()`, WP-Paginate adds an extra class to the `ol` element, `wp-paginate-comments`.
162
 
163
  == Changelog ==
164
+ = 2.1.6 =
165
+ * Improved accessibility by adding aria-label attributes
166
+
167
  = 2.1.5 =
168
  * Updated jQuery function calls
169
  * Replaced old color picker with newer version
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.1.5
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.1.5';
64
 
65
  /**
66
  * @var string The options string name for this plugin
@@ -374,9 +374,9 @@ if (!class_exists('WPPaginate')) {
374
  $prevlink = rtrim($prevlink, '/');
375
  $contains_param = (strpos($prevlink, '?') !== false) ? true : false;
376
  if($slash_option && !$contains_param)
377
- $output .= sprintf('<li><a href="%s/" class="prev">%s</a></li>', $prevlink, stripslashes($previouspage));
378
  else
379
- $output .= sprintf('<li><a href="%s" class="prev">%s</a></li>', $prevlink, stripslashes($previouspage));
380
  }
381
 
382
  $min_links = $range * 2 + 1;
@@ -387,38 +387,38 @@ if (!class_exists('WPPaginate')) {
387
 
388
  if ($left_gap && !$right_gap) {
389
  $output .= sprintf('%s%s%s',
390
- $this->paginate_loop(1, $anchor, 0, $slash_option),
391
  $ellipsis,
392
- $this->paginate_loop($block_min, $pages, $page, $slash_option)
393
  );
394
  }
395
  else if ($left_gap && $right_gap) {
396
  $output .= sprintf('%s%s%s%s%s',
397
- $this->paginate_loop(1, $anchor, 0, $slash_option),
398
  $ellipsis,
399
- $this->paginate_loop($block_min, $block_high, $page, $slash_option),
400
  $ellipsis,
401
- $this->paginate_loop(($pages - $anchor + 1), $pages, 0, $slash_option)
402
  );
403
  }
404
  else if ($right_gap && !$left_gap) {
405
  $output .= sprintf('%s%s%s',
406
- $this->paginate_loop(1, $block_high, $page, $slash_option),
407
  $ellipsis,
408
- $this->paginate_loop(($pages - $anchor + 1), $pages, 0, $slash_option)
409
  );
410
  }
411
  else {
412
- $output .= $this->paginate_loop(1, $pages, $page, $slash_option);
413
  }
414
 
415
  if ($page < $pages && !empty($nextpage)) {
416
  $nextlink = rtrim($nextlink, '/');
417
  $contains_param = (strpos($nextlink, '?') !== false) ? true : false;
418
  if($slash_option && !$contains_param)
419
- $output .= sprintf('<li><a href="%s/" class="next">%s</a></li>', $nextlink, stripslashes($nextpage));
420
  else
421
- $output .= sprintf('<li><a href="%s" class="next">%s</a></li>', $nextlink, stripslashes($nextpage));
422
  }
423
  $output .= "</ol>";
424
  }
@@ -442,8 +442,9 @@ if (!class_exists('WPPaginate')) {
442
  $p = ($this->type === 'posts') ? rtrim(esc_url(get_pagenum_link($i)), '/') : get_comments_pagenum_link($i);
443
  $output .= ($page == intval($i))
444
  ? "<li><span class='page current'>$i</span></li>"
445
- : "<li><a href='$p' title='$i' class='page'>$i</a></li>";
446
- }
 
447
  return $output;
448
  }
449
 
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.1.6
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.1.6';
64
 
65
  /**
66
  * @var string The options string name for this plugin
374
  $prevlink = rtrim($prevlink, '/');
375
  $contains_param = (strpos($prevlink, '?') !== false) ? true : false;
376
  if($slash_option && !$contains_param)
377
+ $output .= sprintf('<li><a href="%s/" class="prev" aria-label="' . __('Go to previous page', 'wp-paginate') . '">%s</a></li>', $prevlink, stripslashes($previouspage));
378
  else
379
+ $output .= sprintf('<li><a href="%s" class="prev" aria-label="' . __('Go to previous page', 'wp-paginate') . '">%s</a></li>', $prevlink, stripslashes($previouspage));
380
  }
381
 
382
  $min_links = $range * 2 + 1;
387
 
388
  if ($left_gap && !$right_gap) {
389
  $output .= sprintf('%s%s%s',
390
+ $this->paginate_loop(1, $anchor, 0, 0, $slash_option),
391
  $ellipsis,
392
+ $this->paginate_loop($block_min, $pages, $page, $page, $slash_option)
393
  );
394
  }
395
  else if ($left_gap && $right_gap) {
396
  $output .= sprintf('%s%s%s%s%s',
397
+ $this->paginate_loop(1, $anchor, 0, 0, $slash_option),
398
  $ellipsis,
399
+ $this->paginate_loop($block_min, $block_high, $page, $page, $slash_option),
400
  $ellipsis,
401
+ $this->paginate_loop(($pages - $anchor + 1), $pages, 0, 0, $slash_option)
402
  );
403
  }
404
  else if ($right_gap && !$left_gap) {
405
  $output .= sprintf('%s%s%s',
406
+ $this->paginate_loop(1, $block_high, $page, $page, $slash_option),
407
  $ellipsis,
408
+ $this->paginate_loop(($pages - $anchor + 1), $pages, 0, 0, $slash_option)
409
  );
410
  }
411
  else {
412
+ $output .= $this->paginate_loop(1, $pages, $page, $page, $slash_option);
413
  }
414
 
415
  if ($page < $pages && !empty($nextpage)) {
416
  $nextlink = rtrim($nextlink, '/');
417
  $contains_param = (strpos($nextlink, '?') !== false) ? true : false;
418
  if($slash_option && !$contains_param)
419
+ $output .= sprintf('<li><a href="%s/" class="next" aria-label="' . __('Go to next page', 'wp-paginate') . '">%s</a></li>', $nextlink, stripslashes($nextpage));
420
  else
421
+ $output .= sprintf('<li><a href="%s" class="next" aria-label="' . __('Go to next page', 'wp-paginate') . '">%s</a></li>', $nextlink, stripslashes($nextpage));
422
  }
423
  $output .= "</ol>";
424
  }
442
  $p = ($this->type === 'posts') ? rtrim(esc_url(get_pagenum_link($i)), '/') : get_comments_pagenum_link($i);
443
  $output .= ($page == intval($i))
444
  ? "<li><span class='page current'>$i</span></li>"
445
+ : "<li><a href='$p' title='$i' aria-label='" . __('Go to page', 'wp-paginate') . " $i' class='page'>$i</a></li>";
446
+ //: "<li><a href='$p' title='$i' aria-label='Go to page $i' class='page'>$i</a></li>";
447
+ }
448
  return $output;
449
  }
450