Opened 7 years ago
Last modified 4 years ago
#46082 new enhancement
Why returning $menu_array[x] instead of $title
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | dev-feedback 2nd-opinion |
| Focuses: | Cc: |
Description
File: wp-admin/includes/plugin.php Function: get_admin_page_title()
In lines 1613, 1616, 1637, 1645 and 1660 the following pattern of assignments and return the value are used:
$title = $menu_array[x]; return $menu_array[x];
where $tile is global.
What is the difference between the following returning patterns
$title = $menu_array[x]; return $menu_array[x];
AND
$title = $menu_array[x]; return $title;
Since we are already updating the the global variable $title with that of $menu_array[x], why can't we just return $title instead of $menu_array[x]? For every single request global $title will receive a new value.
In line 1620 the return pattern is usual:
$title = $menu_array[0]; return $title;
Note: See
TracTickets for help on using
tickets.