mirror of
git://develop.git.wordpress.org/
synced 2025-01-16 20:38:35 +01:00
Coding Standards: Use strict comparison in paginate_links()
.
Follow-up to [4275], [28785]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59606 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
48ba7a364d
commit
9342553d5e
@ -4579,7 +4579,7 @@ function paginate_links( $args = '' ) {
|
||||
$dots = false;
|
||||
|
||||
if ( $args['prev_next'] && $current && 1 < $current ) :
|
||||
$link = str_replace( '%_%', 2 == $current ? '' : $args['format'], $args['base'] );
|
||||
$link = str_replace( '%_%', 2 === $current ? '' : $args['format'], $args['base'] );
|
||||
$link = str_replace( '%#%', $current - 1, $link );
|
||||
if ( $add_args ) {
|
||||
$link = add_query_arg( $add_args, $link );
|
||||
@ -4601,7 +4601,7 @@ function paginate_links( $args = '' ) {
|
||||
endif;
|
||||
|
||||
for ( $n = 1; $n <= $total; $n++ ) :
|
||||
if ( $n == $current ) :
|
||||
if ( $n === $current ) :
|
||||
$page_links[] = sprintf(
|
||||
'<span aria-current="%s" class="page-numbers current">%s</span>',
|
||||
esc_attr( $args['aria_current'] ),
|
||||
@ -4611,7 +4611,7 @@ function paginate_links( $args = '' ) {
|
||||
$dots = true;
|
||||
else :
|
||||
if ( $args['show_all'] || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) :
|
||||
$link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] );
|
||||
$link = str_replace( '%_%', 1 === $n ? '' : $args['format'], $args['base'] );
|
||||
$link = str_replace( '%#%', $n, $link );
|
||||
if ( $add_args ) {
|
||||
$link = add_query_arg( $add_args, $link );
|
||||
|
Loading…
x
Reference in New Issue
Block a user