Administration: Fix an index inconsistency in get_admin_page_title() function.

Ensure that `get_admin_page_title()` returns a value from pages registered using `add_menu_page()`.

Fixes #46081.

Props grapestain, valentinbora, SergeyBiryukov, audrasjb.



git-svn-id: https://develop.svn.wordpress.org/trunk@48500 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jake Spurlock 2020-07-16 22:13:54 +00:00
parent e7671336a4
commit 162afe2451

View File

@ -1956,7 +1956,7 @@ function get_admin_page_title() {
if ( $menu_array[2] == $pagenow ) {
$title = $menu_array[3];
return $menu_array[3];
} elseif ( isset( $plugin_page ) && ( $plugin_page == $menu_array[2] ) && ( $hook == $menu_array[3] ) ) {
} elseif ( isset( $plugin_page ) && ( $plugin_page == $menu_array[2] ) && ( $hook == $menu_array[5] ) ) {
$title = $menu_array[3];
return $menu_array[3];
}