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
This commit is contained in:
Sergey Biryukov
2025-07-11 13:16:28 +00:00
parent a788d1abed
commit 877e90bbff
2 changed files with 3 additions and 5 deletions

View File

@@ -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'] );

View File

@@ -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.