Commit c05f6b8a2c for wordpress.org
commit c05f6b8a2c84d54a647aabdb9893a3cdd2938c15
Author: lancewillett <lancewillett@git.wordpress.org>
Date: Sun Nov 1 23:45:56 2026 +0000
Code Quality: Remove redundant array-offset checks.
Simplify conditions in menu ordering, timezone selection, and REST revision queries where surrounding code already guarantees the checked offset exists. Remove the resolved `isset.offset` PHPStan baseline and its configuration include.
Developed in: https://github.com/WordPress/wordpress-develop/pull/14035
Props huzaifaalmesbah.
See #65817.
Built from https://develop.svn.wordpress.org/trunk@65183
git-svn-id: http://core.svn.wordpress.org/trunk@64332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php
index 6a9925b0d4..6f3b683817 100644
--- a/wp-admin/nav-menus.php
+++ b/wp-admin/nav-menus.php
@@ -197,7 +197,6 @@ switch ( $action ) {
// If this menu item is a child of the previous.
if ( ! empty( $menu_item_data['menu_item_parent'] )
&& isset( $dbids_to_orders[ (int) $menu_item_data['menu_item_parent'] ] )
- && isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] )
&& ( (int) $menu_item_data['menu_item_parent'] === $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] )
) {
if ( in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) {
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index d021b635ed..f7baf953bc 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -6955,7 +6955,7 @@ function wp_timezone_choice( $selected_zone, $locale = null ) {
$structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '" dir="auto">' . esc_html( $display ) . '</option>';
// Close continent optgroup.
- if ( ! empty( $zone['city'] ) && ( ! isset( $zonen[ $key + 1 ] ) || ( isset( $zonen[ $key + 1 ] ) && $zonen[ $key + 1 ]['continent'] !== $zone['continent'] ) ) ) {
+ if ( ! empty( $zone['city'] ) && ( ! isset( $zonen[ $key + 1 ] ) || $zonen[ $key + 1 ]['continent'] !== $zone['continent'] ) ) {
$structure[] = '</optgroup>';
}
}
diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
index 9abced65e6..a68f0cd5a5 100644
--- a/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
+++ b/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
@@ -288,7 +288,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
}
// For backward-compatibility, 'date' needs to resolve to 'date ID'.
- if ( isset( $args['orderby'] ) && 'date' === $args['orderby'] ) {
+ if ( 'date' === $args['orderby'] ) {
$args['orderby'] = 'date ID';
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index cdd2d214a6..e3cc126e71 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-beta3-65182';
+$wp_version = '7.2-beta3-65183';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.