PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.14.1
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.14.1
7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / views / admin / commons / sui-listing / elements / pagination-list.php
wordpress-popup / views / admin / commons / sui-listing / elements Last commit date
actions.php 1 month ago bulk-actions.php 3 years ago empty-message.php 2 years ago empty-search.php 2 years ago module.php 3 years ago pagination-list.php 5 months ago pagination.php 6 years ago summary.php 10 months ago tracking-data-chart.php 5 months ago tracking-data.php 6 years ago
pagination-list.php
127 lines
1 <?php
2 /**
3 * Displays element to paginate modules in the listing page.
4 *
5 * @package Hustle
6 * @since 4.0.0
7 */
8
9 if ( $total <= $entries_per_page ) {
10 return;
11 }
12 // don't use filter_input() here, because of see Hustle_Module_Admin::maybe_remove_paged function.
13 $paged = ! empty( $_GET['paged'] ) ? (int) $_GET['paged'] : 1; // phpcs:ignore
14 $args = array();
15 if ( ! empty( $section ) ) {
16 $args['section'] = $section;
17 }
18 $base_url = add_query_arg( $args, remove_query_arg( 'paged' ) );
19 $max = (int) ceil( $total / $entries_per_page );
20 $short_pagination = 5 > $max;
21 ?>
22 <ul class="sui-pagination">
23 <?php
24 /**
25 * Conditions:
26 * 1. Show this button if there are 5 pages or more.
27 * 2. Hide this button if first page is current page.
28 */
29 if ( ! $short_pagination ) {
30 /**
31 * ELEMENT: Skip to first page
32 */
33 ?>
34 <li class="sui-pagination--start">
35 <a href="<?php echo esc_url( $base_url ); ?>" <?php disabled( $paged <= 1 ); ?>>
36 <span class="sui-icon-arrow-skip-start" aria-hidden="true"></span>
37 <span class="sui-screen-reader-text"><?php esc_html_e( 'Go to first page', 'hustle' ); ?></span>
38 </a>
39 </li>
40
41 <?php
42 /**
43 * ELEMENT: Go to previous page
44 */
45 $u = add_query_arg( 'paged', $paged - 1, $base_url );
46 ?>
47 <li class="sui-pagination--next">
48 <a href="<?php echo esc_url( $u ); ?>" <?php disabled( $paged <= 1 ); ?>>
49 <span class="sui-icon-chevron-left" aria-hidden="true"></span>
50 <span class="sui-screen-reader-text"><?php esc_html_e( 'Go to previous page', 'hustle' ); ?></span>
51 </a>
52 </li>
53 <?php
54 }
55
56 /**
57 * ELEMENT: List of pages
58 *
59 * 1. Use "sui-active" class to determine current page.
60 */
61 $i = 1;
62 do {
63 if ( 1 < $i ) {
64 $u = add_query_arg( 'paged', $i, $base_url );
65 } else {
66 $u = $base_url;
67 }
68 if (
69 ! $short_pagination &&
70 (
71 ( $paged - 2 === $i && 1 !== $i ) ||
72 ( $paged + 2 === $i && $i !== $max )
73 )
74 ) {
75 printf(
76 '<li><a href="%s"> ... </a></li>',
77 esc_url( $u )
78 );
79 } elseif (
80 $short_pagination ||
81 in_array( $i, range( $paged - 2, $paged + 2 ), true )
82 ) {
83 printf(
84 '<li><a class="%s" href="%s">%d</a></li>',
85 esc_attr( $paged === $i ? 'sui-active' : '' ),
86 esc_url( $u ),
87 esc_html( $i )
88 );
89 }
90 ++$i;
91 } while ( $i <= $max );
92
93 /**
94 * Conditions:
95 * 1. Show this button if there are 5 pages or more.
96 * 2. Hide this button if last page is current page.
97 */
98 if ( ! $short_pagination ) {
99 /**
100 * ELEMENT: Go to next page
101 */
102 $u = add_query_arg( 'paged', $paged + 1, $base_url );
103 ?>
104 <li class="sui-pagination--next">
105 <a href="<?php echo esc_url( $u ); ?>" <?php disabled( $paged >= $max ); ?>>
106 <span class="sui-icon-chevron-right" aria-hidden="true"></span>
107 <span class="sui-screen-reader-text"><?php esc_html_e( 'Go to next page', 'hustle' ); ?></span>
108 </a>
109 </li>
110 <?php
111
112 /**
113 * ELEMENT: Skip to last page
114 */
115 $u = add_query_arg( 'paged', $max, $base_url );
116 ?>
117 <li class="sui-pagination--end">
118 <a href="<?php echo esc_url( $u ); ?>" <?php disabled( $paged >= $max ); ?>>
119 <span class="sui-icon-arrow-skip-end" aria-hidden="true"></span>
120 <span class="sui-screen-reader-text"><?php esc_html_e( 'Go to last page', 'hustle' ); ?></span>
121 </a>
122 </li>
123 <?php
124 }
125 ?>
126 </ul>
127