-
Notifications
You must be signed in to change notification settings - Fork 135
/
pagination.php
45 lines (41 loc) · 1.04 KB
/
pagination.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* LLMS Pagination Template
*
* @package LifterLMS/Templates/Loop
*
* @since 1.0.0
* @version 4.10.0
*/
defined( 'ABSPATH' ) || exit;
global $wp_query;
if ( $wp_query->max_num_pages < 2 ) {
return;
}
/**
* Filter the list of CSS classes on the pagination wrapper element.
*
* @since 4.10.0
*
* @param string[] $classes Array of CSS classes.
*/
$classes = apply_filters( 'llms_get_pagination_wrapper_classes', array( 'llms-pagination' ) );
?>
<nav class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
<?php
// Generated HTML is escaped inside the function.
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo paginate_links(
array(
'base' => str_replace( 999999, '%#%', esc_url( get_pagenum_link( 999999 ) ) ),
'format' => '?page=%#%',
'total' => $wp_query->max_num_pages,
'current' => max( 1, get_query_var( 'paged' ) ),
'prev_next' => true,
'prev_text' => '« ' . __( 'Previous', 'lifterlms' ),
'next_text' => __( 'Next', 'lifterlms' ) . ' »',
'type' => 'list',
)
);
?>
</nav>