From 877e90bbffaed00897cd8ab78e497d98adda36f7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 11 Jul 2025 13:16:28 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@60447 git-svn-id: http://core.svn.wordpress.org/trunk@59783 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rewrite.php | 6 ++---- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 235c0c82e2..246846dc35 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -412,7 +412,7 @@ function wp_resolve_numeric_slug_conflicts( $query_vars = array() ) { // This is the potentially clashing slug. $value = ''; - if ( $compare && array_key_exists( $compare, $query_vars ) ) { + if ( array_key_exists( $compare, $query_vars ) ) { $value = $query_vars[ $compare ]; } @@ -460,9 +460,7 @@ function wp_resolve_numeric_slug_conflicts( $query_vars = array() ) { } // If we've gotten to this point, we have a slug/date clash. First, adjust for nextpage. - if ( '' !== $maybe_page ) { - $query_vars['page'] = (int) $maybe_page; - } + $query_vars['page'] = $maybe_page; // Next, unset autodetected date-related query vars. unset( $query_vars['year'] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index d3fb16ed55..d653fc86a8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-alpha-60446'; +$wp_version = '6.9-alpha-60447'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.