From 6ead8cfda811f9336e25df955fb453e84524c10e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 16 Feb 2023 00:04:21 +0000 Subject: [PATCH] Coding Standards: Replace `strval()` with `(string)` type casting in `wp_nav_menu()`. This adjusts a newly introduced instance for consistency with the rest of core. Follow-up to [49108], [55059]. See #57169. Built from https://develop.svn.wordpress.org/trunk@55352 git-svn-id: http://core.svn.wordpress.org/trunk@54885 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu-template.php | 5 ++--- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index e6166b49d4..46a4d95c38 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -200,10 +200,9 @@ function wp_nav_menu( $args = array() ) { foreach ( (array) $menu_items as $menu_item ) { /* * Fix invalid `menu_item_parent`. See: https://core.trac.wordpress.org/ticket/56926. - * Compare as strings. Plugins may change the ID to string. - * To avoid modifying the object, use `strval()` rather than casting to (string). + * Compare as strings. Plugins may change the ID to a string. */ - if ( strval( $menu_item->ID ) === strval( $menu_item->menu_item_parent ) ) { + if ( (string) $menu_item->ID === (string) $menu_item->menu_item_parent ) { $menu_item->menu_item_parent = 0; } diff --git a/wp-includes/version.php b/wp-includes/version.php index dc2942647b..ef1576b391 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-beta2-55351'; +$wp_version = '6.2-beta2-55352'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.