From 5d55d3cff3586dc4ec6e7f077fa8eee2b6be8ce7 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Fri, 17 Jun 2022 03:59:03 +0200
Subject: [PATCH] PHP 8.1 | add_submenu_page(): fix float to int conversion
with loss of precision
---
src/wp-admin/includes/plugin.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php
index 7834abe6f2..3053971e48 100644
a
|
b
|
function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, |
1454 | 1454 | // For negative or `0` positions, prepend the submenu. |
1455 | 1455 | array_unshift( $submenu[ $parent_slug ], $new_sub_menu ); |
1456 | 1456 | } else { |
| 1457 | $position = absint( $position ); |
1457 | 1458 | // Grab all of the items before the insertion point. |
1458 | 1459 | $before_items = array_slice( $submenu[ $parent_slug ], 0, $position, true ); |
1459 | 1460 | // Grab all of the items after the insertion point. |