Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelogs/fix_paginate-links-warning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: patch
type: fixed
entry: Fixed warnings from running `wp_kses_post()` on empty `paginate_links()` calls.
25 changes: 13 additions & 12 deletions includes/shortcodes/class.llms.shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,20 +368,21 @@ public static function memberships( $atts ) {
do_action( 'lifterlms_after_loop' );

echo '<nav class="llms-pagination">';
echo wp_kses_post(
paginate_links(
array(
'base' => str_replace( 999999, '%#%', esc_url( get_pagenum_link( 999999 ) ) ),
'format' => '?page=%#%',
'total' => $query->max_num_pages,
'current' => max( 1, $args['paged'] ),
'prev_next' => true,
'prev_text' => '«' . __( 'Previous', 'lifterlms' ),
'next_text' => __( 'Next', 'lifterlms' ) . '»',
'type' => 'list',
)
$pagination = paginate_links(
array(
'base' => str_replace( 999999, '%#%', esc_url( get_pagenum_link( 999999 ) ) ),
'format' => '?page=%#%',
'total' => $query->max_num_pages,
'current' => max( 1, $args['paged'] ),
'prev_next' => true,
'prev_text' => '«' . __( 'Previous', 'lifterlms' ),
'next_text' => __( 'Next', 'lifterlms' ) . '»',
'type' => 'list',
)
);
if ( ! empty( $pagination ) ) {
echo wp_kses_post( $pagination );
}
echo '</nav>';

else :
Expand Down
7 changes: 5 additions & 2 deletions templates/myaccount/my-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<footer class="llms-sd-pagination llms-my-notifications-pagination">
<nav class="llms-pagination">
<?php
echo wp_kses_post( paginate_links(
$pagination = paginate_links(
array(
'base' => str_replace( 999999, '%#%', esc_url( get_pagenum_link( 999999 ) ) ),
'format' => '?page=%#%',
Expand All @@ -39,7 +39,10 @@
'next_text' => __( 'Next', 'lifterlms' ) . ' »',
'type' => 'list',
)
) );
);
if ( ! empty( $pagination ) ) {
echo wp_kses_post( $pagination );
}
?>
</nav>
</footer>
Expand Down