Skip to content

Commit b38123c

Browse files
Coding Standards: Remove redundant checks in wp_resolve_numeric_slug_conflicts().
This commit removes two unnecessary conditional checks: * A truthy check for `$compare`, as a falsey value causes an earlier return a few lines above. * A check to ensure `$maybe_page` is not an empty string, as it is already cast to an integer. Follow-up to [32648], [34492], [53857]. Props justlevine. See #63268. git-svn-id: https://develop.svn.wordpress.org/trunk@60447 602fd350-edb4-49c9-b593-d223f7449a82
1 parent eadf08b commit b38123c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/wp-includes/rewrite.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ function wp_resolve_numeric_slug_conflicts( $query_vars = array() ) {
412412

413413
// This is the potentially clashing slug.
414414
$value = '';
415-
if ( $compare && array_key_exists( $compare, $query_vars ) ) {
415+
if ( array_key_exists( $compare, $query_vars ) ) {
416416
$value = $query_vars[ $compare ];
417417
}
418418

@@ -460,9 +460,7 @@ function wp_resolve_numeric_slug_conflicts( $query_vars = array() ) {
460460
}
461461

462462
// If we've gotten to this point, we have a slug/date clash. First, adjust for nextpage.
463-
if ( '' !== $maybe_page ) {
464-
$query_vars['page'] = (int) $maybe_page;
465-
}
463+
$query_vars['page'] = $maybe_page;
466464

467465
// Next, unset autodetected date-related query vars.
468466
unset( $query_vars['year'] );

0 commit comments

Comments
 (0)