WP-PageNavi - Version 2.91

Version Description

  • Validate text option against kses
  • Update SCB Framework
Download this release

Release Info

Developer GamerZ
Plugin Icon WP-PageNavi
Version 2.91
Comparing to
See all releases

Code changes from version 2.90 to 2.91

Files changed (7) hide show
  1. admin.php +10 -6
  2. core.php +3 -0
  3. readme.txt +20 -104
  4. scb/Forms.php +4 -0
  5. scb/load.php +1 -1
  6. uninstall.php +4 -3
  7. wp-pagenavi.php +1 -1
admin.php CHANGED
@@ -14,12 +14,16 @@ class PageNavi_Options_Page extends scbAdminPage {
14
 
15
  function validate( $new_data, $old_data ) {
16
  $options = wp_parse_args($new_data, $old_data);
17
- foreach ( array( 'style', 'num_pages', 'num_larger_page_numbers', 'larger_page_numbers_multiple' ) as $key )
18
- $options[$key] = absint( @$options[$key] );
19
-
20
- foreach ( array( 'use_pagenavi_css', 'always_show' ) as $key )
21
- $options[$key] = intval(@$options[$key]);
22
-
 
 
 
 
23
  return $options;
24
  }
25
 
14
 
15
  function validate( $new_data, $old_data ) {
16
  $options = wp_parse_args($new_data, $old_data);
17
+ foreach ( array( 'style', 'num_pages', 'num_larger_page_numbers', 'larger_page_numbers_multiple' ) as $key ) {
18
+ $options[ $key ] = absint( @$options[ $key ] );
19
+ }
20
+ foreach ( array( 'use_pagenavi_css', 'always_show' ) as $key ) {
21
+ $options[ $key ] = intval( @$options[ $key ] );
22
+ }
23
+ foreach ( array( 'pages_text', 'current_text', 'page_text', 'first_text', 'last_text', 'prev_text', 'next_text', 'dotleft_text', 'dotright_text' ) as $key ) {
24
+ $options[ $key ] = wp_kses_post( @$options[ $key ] );
25
+ }
26
+
27
  return $options;
28
  }
29
 
core.php CHANGED
@@ -125,6 +125,7 @@ function wp_pagenavi( $args = array() ) {
125
  if ( $larger_page < ($start_page - $half_page_start) && $larger_page_start < $larger_page_to_show ) {
126
  $out .= $instance->get_single( $larger_page, $options['page_text'], array(
127
  'class' => "{$class_names['smaller']} {$class_names['page']}",
 
128
  ) );
129
  $larger_page_start++;
130
  }
@@ -143,6 +144,7 @@ function wp_pagenavi( $args = array() ) {
143
  } else {
144
  $out .= $instance->get_single( $i, $options['page_text'], array(
145
  'class' => "{$class_names['page']} {$class_names[$timeline]}",
 
146
  ) );
147
  }
148
  }
@@ -154,6 +156,7 @@ function wp_pagenavi( $args = array() ) {
154
  if ( $larger_page > ($end_page + $half_page_end) && $larger_page_end < $larger_page_to_show ) {
155
  $larger_page_out .= $instance->get_single( $larger_page, $options['page_text'], array(
156
  'class' => "{$class_names['larger']} {$class_names['page']}",
 
157
  ) );
158
  $larger_page_end++;
159
  }
125
  if ( $larger_page < ($start_page - $half_page_start) && $larger_page_start < $larger_page_to_show ) {
126
  $out .= $instance->get_single( $larger_page, $options['page_text'], array(
127
  'class' => "{$class_names['smaller']} {$class_names['page']}",
128
+ 'title' => sprintf( __( 'Page %d', 'wp-pagenavi' ), number_format_i18n( $larger_page ) ),
129
  ) );
130
  $larger_page_start++;
131
  }
144
  } else {
145
  $out .= $instance->get_single( $i, $options['page_text'], array(
146
  'class' => "{$class_names['page']} {$class_names[$timeline]}",
147
+ 'title' => sprintf( __( 'Page %d', 'wp-pagenavi' ), number_format_i18n( $i ) ),
148
  ) );
149
  }
150
  }
156
  if ( $larger_page > ($end_page + $half_page_end) && $larger_page_end < $larger_page_to_show ) {
157
  $larger_page_out .= $instance->get_single( $larger_page, $options['page_text'], array(
158
  'class' => "{$class_names['larger']} {$class_names['page']}",
159
+ 'title' => sprintf( __( 'Page %d', 'wp-pagenavi' ), number_format_i18n( $larger_page ) ),
160
  ) );
161
  $larger_page_end++;
162
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WP-PageNavi ===
2
  Contributors: GamerZ, scribu
3
- Donate link: http://lesterchan.net/site/donation/
4
  Tags: navigation, pagination, paging, pages
5
  Requires at least: 3.2
6
- Tested up to: 4.5
7
- Stable tag: 2.90
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -13,31 +13,9 @@ Adds a more advanced paging navigation interface.
13
  == Description ==
14
  Want to replace the old *&larr; Older posts | Newer posts &rarr;* links with some page links?
15
 
16
- This plugin provides the `wp_pagenavi()` template tag which generates fancy pagination links. See the [installation instructions](http://wordpress.org/extend/plugins/wp-pagenavi/installation/) for using it in your theme.
17
-
18
- Help to translate at <https://translate.foe-services.de/projects/wp-pagenavi>.
19
-
20
- = Build Status =
21
- [![Build Status](https://travis-ci.org/lesterchan/wp-pagenavi.svg?branch=master)](https://travis-ci.org/lesterchan/wp-pagenavi)
22
-
23
- = Development =
24
- * [https://github.com/lesterchan/wp-pagenavi](https://github.com/lesterchan/wp-pagenavi "https://github.com/lesterchan/wp-pagenavi")
25
-
26
- = Credits =
27
- * Plugin icon by [SimpleIcon](http://www.simpleicon.com) from [Flaticon](http://www.flaticon.com)
28
-
29
- = Donations =
30
- I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
31
-
32
- == Installation ==
33
-
34
- You can either install it automatically from the WordPress admin, or do it manually:
35
-
36
- 1. Unzip the archive and put the `wp-pagenavi` folder into your plugins folder (/wp-content/plugins/).
37
- 1. Activate the plugin from the Plugins menu.
38
 
39
  = Usage =
40
-
41
  In your theme, you need to find calls to next_posts_link() and previous_posts_link() and replace them.
42
 
43
  In the Twentyten theme, it looks like this:
@@ -126,6 +104,18 @@ function theme_pagination_class($class_name) {
126
  }
127
  `
128
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  == Screenshots ==
130
 
131
  1. With Custom Styling
@@ -157,6 +147,10 @@ You can do that like so:
157
  `<?php wp_pagenavi( array( 'options' => PageNavi_Core::$options->get_defaults() ) ); ?>`
158
 
159
  == Changelog ==
 
 
 
 
160
  = 2.90 =
161
  * Remove po/mo files from the plugin
162
  * Use translate.wordpress.org to translate the plugin
@@ -206,81 +200,3 @@ You can do that like so:
206
  * added $query arg to wp_pagenavi()
207
  * updated translations
208
  * [more info](http://scribu.net/wordpress/wp-pagenavi/wpn-2-74.html)
209
-
210
- = 2.73 (2010-08-17) =
211
- * added $options arg to wp_pagenavi()
212
- * updated scbFramework
213
- * 3 new translations: AL, JA, BR
214
-
215
- = 2.72 (2010-04-19) =
216
- * fixed first link
217
-
218
- = 2.71 (2010-04-18) =
219
- * remove conflicting .left and .right from .extend elements
220
- * bundle language files
221
-
222
- = 2.70 (2010-04-11) =
223
- * better default CSS
224
- * fixed issue with slashed quotes in settings
225
- * let WordPress handle uninstallation
226
- * [more info](http://scribu.net/wordpress/wp-pagenavi/wp-2-70.html)
227
-
228
- = 2.61 (2010-02-07) =
229
- * fixed: memory limit error
230
-
231
- = 2.60 (2010-02-07) =
232
- * new: Compatible With WordPress 2.9
233
- * new: Added "previouspostslink" and "nextpostslink" CSS classes for styling next/previous posts link by Joost de Valk
234
- * new: Added option to include pagenavi-css.css In WP-Admin -> Settings -> PageNavi
235
- * fixed: check for pagenavi-css.css in the child theme, first
236
- * fixed: cleaner options page
237
-
238
- = 2.50 (2009-06-01) =
239
- * new: Compatible With WordPress 2.8
240
- * new: Added Larger Page Number Pagination
241
- * new: Added "first", "page" and "last" CSS Name To Link
242
- * fixed: Removed "&#8201;" Entity
243
- * fixed: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']
244
-
245
- = 2.40 (2008-12-12) =
246
- * new: Compatible With WordPress 2.7 Only
247
- * new: Right To Left Language Support by Kambiz R. Khojasteh
248
- * new: Called pagenavi_textdomain() In pagenavi_init() by Kambiz R. Khojasteh
249
-
250
- = 2.31 (2008-07-16) =
251
- * new: Compatible With WordPress 2.6
252
-
253
- = 2.30 (2008-06-01) =
254
- * new: WP-PageNavi Will Load 'pagenavi-css.css' Inside Your Theme Directory If It Exists. If Not, It Will Just Load The Default 'pagenavi-css.css' By WP-PageNavi
255
- * new: Uses /wp-pagenavi/ Folder Instead Of /pagenavi/
256
- * new: Uses wp-pagenavi.php Instead Of pagenavi.php
257
- * new: Added "wp-pagenavi a:visited" Style In pagenavi-css.css
258
- * new: Added $before And $after Function Arguments To wp_pagenavi();
259
- * fixed: Rearranged CSS Classes In pagenavi-css.css
260
- * fixed: "First" Text Does Not Always Appear If Page 1 Is Not Shown
261
-
262
- = 2.20 (2007-10-01) =
263
- * new: Supports query_posts(); Variables
264
- * new: Ability To Uninstall WP-PageNavi
265
-
266
- = 2.11 (2007-06-01) =
267
- * new: Page Navigation Now Is Customizable Via 'WP-Admin -> Options -> PageNavi' And pagenavi-css.css
268
- * new: Default Style Navigation Is Now Boxed Navigation (Similar To Digg.com)
269
- * fixed: Fix For Ultimate Tag Warrior By Oliver Kastler & Stephan (Netconcepts)
270
-
271
- = 2.10 (2007-02-01) =
272
- * new: Compatible With WordPress 2.1 Only
273
- * new: Move pagenavi.php To pagenavi Folder
274
-
275
- = 2.03 (2006-10-01) =
276
- * fixed: Now Compatible With WordPress 2.1
277
-
278
- = 2.02 (2006-06-01) =
279
- * new: Added Drop Down Menu Style Of Page Navigation
280
-
281
- = 2.01 (2006-03-01) =
282
- * fixed: Paging Show If There Is Only 1 Page
283
-
284
- = 2.00 (2006-01-01) =
285
- * new: Compatible With WordPress 2.0
286
- * fixed: Space Issues
1
  === WP-PageNavi ===
2
  Contributors: GamerZ, scribu
3
+ Donate link: https://lesterchan.net/site/donation/
4
  Tags: navigation, pagination, paging, pages
5
  Requires at least: 3.2
6
+ Tested up to: 4.7
7
+ Stable tag: 2.91
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
13
  == Description ==
14
  Want to replace the old *&larr; Older posts | Newer posts &rarr;* links with some page links?
15
 
16
+ This plugin provides the `wp_pagenavi()` template tag which generates fancy pagination links.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  = Usage =
 
19
  In your theme, you need to find calls to next_posts_link() and previous_posts_link() and replace them.
20
 
21
  In the Twentyten theme, it looks like this:
104
  }
105
  `
106
 
107
+ = Build Status =
108
+ [![Build Status](https://travis-ci.org/lesterchan/wp-pagenavi.svg?branch=master)](https://travis-ci.org/lesterchan/wp-pagenavi)
109
+
110
+ = Development =
111
+ * [https://github.com/lesterchan/wp-pagenavi](https://github.com/lesterchan/wp-pagenavi "https://github.com/lesterchan/wp-pagenavi")
112
+
113
+ = Credits =
114
+ * Plugin icon by [SimpleIcon](http://www.simpleicon.com) from [Flaticon](http://www.flaticon.com)
115
+
116
+ = Donations =
117
+ I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
118
+
119
  == Screenshots ==
120
 
121
  1. With Custom Styling
147
  `<?php wp_pagenavi( array( 'options' => PageNavi_Core::$options->get_defaults() ) ); ?>`
148
 
149
  == Changelog ==
150
+ = 2.91 =
151
+ * Validate text option against kses
152
+ * Update SCB Framework
153
+
154
  = 2.90 =
155
  * Remove po/mo files from the plugin
156
  * Use translate.wordpress.org to translate the plugin
200
  * added $query arg to wp_pagenavi()
201
  * updated translations
202
  * [more info](http://scribu.net/wordpress/wp-pagenavi/wpn-2-74.html)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scb/Forms.php CHANGED
@@ -606,6 +606,10 @@ abstract class scbFormField implements scbFormField_I {
606
  * @return string
607
  */
608
  protected static function add_label( $input, $desc, $desc_pos ) {
 
 
 
 
609
  return html( 'label', self::add_desc( $input, $desc, $desc_pos ) ) . "\n";
610
  }
611
 
606
  * @return string
607
  */
608
  protected static function add_label( $input, $desc, $desc_pos ) {
609
+ if ( empty( $desc ) ) {
610
+ return $input;
611
+ }
612
+
613
  return html( 'label', self::add_desc( $input, $desc, $desc_pos ) ) . "\n";
614
  }
615
 
scb/load.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $GLOBALS['_scb_data'] = array( 60, __FILE__, array(
4
  'scbUtil',
5
  'scbOptions',
6
  'scbForms',
1
  <?php
2
 
3
+ $GLOBALS['_scb_data'] = array( 61, __FILE__, array(
4
  'scbUtil',
5
  'scbOptions',
6
  'scbForms',
uninstall.php CHANGED
@@ -11,11 +11,12 @@ $option_names = array(
11
 
12
 
13
  if ( is_multisite() ) {
14
- $ms_sites = wp_get_sites();
15
 
16
  if( 0 < sizeof( $ms_sites ) ) {
17
  foreach ( $ms_sites as $ms_site ) {
18
- switch_to_blog( $ms_site['blog_id'] );
 
19
  if( sizeof( $option_names ) > 0 ) {
20
  foreach( $option_names as $option_name ) {
21
  delete_option( $option_name );
@@ -43,4 +44,4 @@ if ( is_multisite() ) {
43
  */
44
  function plugin_uninstalled() {
45
  global $wpdb;
46
- }
11
 
12
 
13
  if ( is_multisite() ) {
14
+ $ms_sites = function_exists( 'get_sites' ) ? get_sites() : wp_get_sites();
15
 
16
  if( 0 < sizeof( $ms_sites ) ) {
17
  foreach ( $ms_sites as $ms_site ) {
18
+ $blog_id = isset( $ms_site['blog_id'] ) ? $ms_site['blog_id'] : $ms_site->blog_id;
19
+ switch_to_blog( $blog_id );
20
  if( sizeof( $option_names ) > 0 ) {
21
  foreach( $option_names as $option_name ) {
22
  delete_option( $option_name );
44
  */
45
  function plugin_uninstalled() {
46
  global $wpdb;
47
+ }
wp-pagenavi.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-PageNavi
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Adds a more advanced paging navigation to your WordPress blog
6
- Version: 2.90
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-pagenavi
3
  Plugin Name: WP-PageNavi
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Adds a more advanced paging navigation to your WordPress blog
6
+ Version: 2.91
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-pagenavi