WP-Paginate - Version 2.1.1

Version Description

  • Added setting to remove ellipses from pagination links
  • Added code to load jquery-migrate
Download this release

Release Info

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

Code changes from version 2.1.0 to 2.1.1

Files changed (2) hide show
  1. readme.txt +5 -1
  2. wp-paginate.php +21 -3
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.5
6
- Stable tag: 2.1.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -159,6 +159,10 @@ 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.1.0 =
163
  * Tested with WordPress 5.5
164
 
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.5
6
+ Stable tag: 2.1.1
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.1.1 =
163
+ * Added setting to remove ellipses from pagination links
164
+ * Added code to load jquery-migrate
165
+
166
  = 2.1.0 =
167
  * Tested with WordPress 5.5
168
 
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.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.1.0';
64
 
65
  /**
66
  * @var string The options string name for this plugin
@@ -259,6 +259,7 @@ if (!class_exists('WPPaginate')) {
259
  wp_enqueue_style( 'wp-paginate-admin', plugins_url( '/css/wp-paginate-admin.css', __FILE__ ));
260
 
261
  wp_enqueue_script('jquery');
 
262
  wp_register_script( 'wpp-script', $this->pluginurl .'js/wp-paginate.js', array( 'jquery' ), '', true );
263
 
264
  wp_localize_script( 'wpp-script', 'wpp_ajax',
@@ -363,7 +364,11 @@ if (!class_exists('WPPaginate')) {
363
  if (strlen(stripslashes($title)) > 0) {
364
  $output .= sprintf('<li><span class="title">%s</span></li>', stripslashes($title));
365
  }
366
- $ellipsis = "<li><span class='gap'>...</span></li>";
 
 
 
 
367
 
368
  if ($page > 1 && !empty($previouspage)) {
369
  $prevlink = rtrim($prevlink, '/');
@@ -494,6 +499,7 @@ if (!class_exists('WPPaginate')) {
494
  'archive-page' => false,
495
  'position' => 'none',
496
  'hide-standard-pagination' => false,
 
497
  'font' => 'font-inherit',
498
  'preset' => 'default'
499
  );
@@ -563,6 +569,7 @@ if (!class_exists('WPPaginate')) {
563
  if(isset($_POST['position']))
564
  $this->options['position'] = $_POST['position'];
565
  $this->options['hide-standard-pagination'] = (isset($_POST['hide-standard-pagination']) && $_POST['hide-standard-pagination'] === 'on') ? true : false;
 
566
  if(isset($_POST['font']))
567
  $this->options['font'] = $_POST['font'];
568
  if(isset($_POST['preset']))
@@ -751,6 +758,17 @@ if (!class_exists('WPPaginate')) {
751
  </select>
752
  <span class="description"><?php _e('Select the font to use with the pagination.', 'wp-paginate'); ?></span></td>
753
  </tr>
 
 
 
 
 
 
 
 
 
 
 
754
  <tr valign="top">
755
  <th scope="row"><?php _e('Button Style:', 'wp-paginate'); ?></th>
756
  <input type='hidden' value='<?php echo $this->options['preset']; ?>' name='preset' id='preset'>
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.1
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.1';
64
 
65
  /**
66
  * @var string The options string name for this plugin
259
  wp_enqueue_style( 'wp-paginate-admin', plugins_url( '/css/wp-paginate-admin.css', __FILE__ ));
260
 
261
  wp_enqueue_script('jquery');
262
+ wp_enqueue_script('jquery-migrate', ABSPATH . WPINC . '/js/jquery/jquery-migrate.min.js', array('jquery'));
263
  wp_register_script( 'wpp-script', $this->pluginurl .'js/wp-paginate.js', array( 'jquery' ), '', true );
264
 
265
  wp_localize_script( 'wpp-script', 'wpp_ajax',
364
  if (strlen(stripslashes($title)) > 0) {
365
  $output .= sprintf('<li><span class="title">%s</span></li>', stripslashes($title));
366
  }
367
+ error_log("hide ellipses " . $this->options['hide-ellipses']);
368
+ if($this->options['hide-ellipses'] == true )
369
+ $ellipsis = "<li></li>";
370
+ else
371
+ $ellipsis = "<li><span class='gap'>...</span></li>";
372
 
373
  if ($page > 1 && !empty($previouspage)) {
374
  $prevlink = rtrim($prevlink, '/');
499
  'archive-page' => false,
500
  'position' => 'none',
501
  'hide-standard-pagination' => false,
502
+ 'hide-ellipses' => false,
503
  'font' => 'font-inherit',
504
  'preset' => 'default'
505
  );
569
  if(isset($_POST['position']))
570
  $this->options['position'] = $_POST['position'];
571
  $this->options['hide-standard-pagination'] = (isset($_POST['hide-standard-pagination']) && $_POST['hide-standard-pagination'] === 'on') ? true : false;
572
+ $this->options['hide-ellipses'] = (isset($_POST['hide-ellipses']) && $_POST['hide-ellipses'] === 'on') ? true : false;
573
  if(isset($_POST['font']))
574
  $this->options['font'] = $_POST['font'];
575
  if(isset($_POST['preset']))
758
  </select>
759
  <span class="description"><?php _e('Select the font to use with the pagination.', 'wp-paginate'); ?></span></td>
760
  </tr>
761
+ <tr valign="top">
762
+ <th scope="row"><?php _e('Hide Ellipses:', 'wp-paginate'); ?></th>
763
+ <td><label for="hide-ellipses">
764
+ <?php
765
+ if(isset($this->options['hide-ellipses']))
766
+ $hide_ellipses = $this->options['hide-ellipses'];
767
+ else
768
+ $hide_ellipses = 'none';
769
+ ?>
770
+ <input type="checkbox" id="hide-ellipses" name="hide-ellipses" <?php echo ($hide_ellipses === true) ? "checked='checked'" : ""; ?>/> <?php _e('Remove ellipses from the pagination links.', 'wp-paginate'); ?></label></td>
771
+ </tr>
772
  <tr valign="top">
773
  <th scope="row"><?php _e('Button Style:', 'wp-paginate'); ?></th>
774
  <input type='hidden' value='<?php echo $this->options['preset']; ?>' name='preset' id='preset'>