adding some code standard exceptions
This commit is contained in:
parent
9717e451cf
commit
246cfb4a26
|
@ -48,12 +48,13 @@ function understrap_pagination() {
|
|||
|
||||
printf( // WPCS: XSS OK.
|
||||
'<li %s><a class="page-link" href="%s"><i class="fa fa-step-backward" aria-hidden="true"></i></a></li>' . "\n",
|
||||
$class,
|
||||
$class,
|
||||
esc_url( get_pagenum_link( 1 ) ), '1' );
|
||||
|
||||
/** Previous Post Link */
|
||||
if ( get_previous_posts_link() ) {
|
||||
printf( '<li class="page-item"><span class="page-link">%1$s</span></li> ' . "\n",
|
||||
printf( // WPCS: XSS OK.
|
||||
'<li class="page-item"><span class="page-link">%1$s</span></li> ' . "\n",
|
||||
get_previous_posts_link( // WPCS: XSS OK.
|
||||
'<span aria-hidden="true">«</span><span class="sr-only">Previous page</span>' ) );
|
||||
}
|
||||
|
@ -68,14 +69,15 @@ function understrap_pagination() {
|
|||
foreach ( (array) $links as $link ) {
|
||||
$class = $paged == $link ? ' class="active page-item"' : ' class="page-item"';
|
||||
printf( // WPCS: XSS OK.
|
||||
'<li %s><a href="%s" class="page-link">%s</a></li>' . "\n",
|
||||
$class,
|
||||
'<li %s><a href="%s" class="page-link">%s</a></li>' . "\n",
|
||||
$class,
|
||||
esc_url( get_pagenum_link( $link ) ), $link );
|
||||
}
|
||||
|
||||
// Next Post Link.
|
||||
if ( get_next_posts_link() ) {
|
||||
printf( '<li class="page-item"><span class="page-link">%s</span></li>' . "\n",
|
||||
printf( // WPCS: XSS OK.
|
||||
'<li class="page-item"><span class="page-link">%s</span></li>' . "\n",
|
||||
get_next_posts_link( '<span aria-hidden="true">»</span><span class="sr-only">Next page</span>' ) );
|
||||
}
|
||||
|
||||
|
@ -86,7 +88,8 @@ function understrap_pagination() {
|
|||
}
|
||||
|
||||
$class = $paged == $max ? ' class="active "' : ' class="page-item"';
|
||||
printf( '<li %s><a class="page-link" href="%s" aria-label="Next"><span aria-hidden="true"><i class="fa fa-step-forward" aria-hidden="true"></i></span><span class="sr-only">%s</span></a></li>' . "\n",
|
||||
printf( // WPCS: XSS OK.
|
||||
'<li %s><a class="page-link" href="%s" aria-label="Next"><span aria-hidden="true"><i class="fa fa-step-forward" aria-hidden="true"></i></span><span class="sr-only">%s</span></a></li>' . "\n",
|
||||
$class . ' page-item 9', esc_url( get_pagenum_link( esc_html( $max ) ) ), esc_html( $max ) );
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue