[wp-trac] [WordPress Trac] #59420: Remove unused variables on the wp-includes folder.
WordPress Trac
noreply at wordpress.org
Thu Sep 21 11:54:47 UTC 2023
#59420: Remove unused variables on the wp-includes folder.
--------------------------+-------------------------------
Reporter: upadalavipul | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.4
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses: coding-standards
--------------------------+-------------------------------
Changes (by SergeyBiryukov):
* milestone: Awaiting Review => 6.4
Comment:
Hi there, thanks for the patch!
The `$_wp_switched_stack` and `$switched` globals are initialized in `wp-
includes/ms-settings.php` for later use in `switch_to_blog()` and
`restore_current_blog()` functions, see [21485]:
> wp-includes/ms-settings.php:
> Define $_wp_switched_stack and $_wp_switched. This way switch_to_blog()
and restore_current_blog() can rely on it being set.
So they cannot be removed.
The `$response` variable in `WP_REST_Server::match_request_to_handler()`,
on the other hand, indeed appears to be unused.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59420#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list