wp/wp-admin/menu-header.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
--- a/wp/wp-admin/menu-header.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-admin/menu-header.php	Fri Sep 05 18:40:08 2025 +0200
@@ -98,7 +98,7 @@
 		} else {
 			$class[] = 'wp-not-current-submenu';
 			if ( ! empty( $submenu_items ) ) {
-				$aria_attributes .= 'aria-haspopup="true"';
+				$aria_attributes .= 'data-ariahaspopup';
 			}
 		}
 
@@ -112,7 +112,7 @@
 		$img_style = '';
 		$img_class = ' dashicons-before';
 
-		if ( false !== strpos( $class, 'wp-menu-separator' ) ) {
+		if ( str_contains( $class, 'wp-menu-separator' ) ) {
 			$is_separator = true;
 		}
 
@@ -127,12 +127,12 @@
 
 			if ( 'none' === $item[6] || 'div' === $item[6] ) {
 				$img = '<br />';
-			} elseif ( 0 === strpos( $item[6], 'data:image/svg+xml;base64,' ) ) {
+			} elseif ( str_starts_with( $item[6], 'data:image/svg+xml;base64,' ) ) {
 				$img = '<br />';
 				// The value is base64-encoded data, so esc_attr() is used here instead of esc_url().
 				$img_style = ' style="background-image:url(\'' . esc_attr( $item[6] ) . '\')"';
 				$img_class = ' svg';
-			} elseif ( 0 === strpos( $item[6], 'dashicons-' ) ) {
+			} elseif ( str_starts_with( $item[6], 'dashicons-' ) ) {
 				$img       = '<br />';
 				$img_class = ' dashicons-before ' . sanitize_html_class( $item[6] );
 			}
@@ -226,8 +226,10 @@
 						$class[]          = 'current';
 						$aria_attributes .= ' aria-current="page"';
 					}
-					// If plugin_page is set the parent must either match the current page or not physically exist.
-					// This allows plugin pages with the same hook to exist under different parents.
+					/*
+					 * If plugin_page is set the parent must either match the current page or not physically exist.
+					 * This allows plugin pages with the same hook to exist under different parents.
+					 */
 				} elseif (
 					( ! isset( $plugin_page ) && $self === $sub_item[2] )
 					|| ( isset( $plugin_page ) && $plugin_page === $sub_item[2]