Opened 20 months ago
Closed 6 months ago
#62562 closed enhancement (fixed)
Ensure get_current_screen() returns WP_Screen|null
| Reported by: | marian1 | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0 |
| Component: | Administration | Version: | |
| Severity: | trivial | Keywords: | has-patch dev-feedback |
| Cc: | Focuses: |
Description
Currently, get_current_screen() simply checks whether the global variable $current_screen is set before returning it. Since global variables may be overridden, it should confirm that $current_screen is actually a WP_Screen object to ensure that get_current_screen() reliably returns a valid WP_Screen object.
Change History (6)
This ticket was mentioned in PR #7885 on WordPress/wordpress-develop by @marian1.
20 months ago
#1
- Keywords has-patch added; needs-patch removed
#3
@
20 months ago
- Keywords needs-testing removed
Test Report
Description
This report validates that the indicated patch works as expected.
Environment
- WordPress: 6.8-alpha-59274-src
- PHP: 8.2.25
- Server: nginx/1.27.2
- Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
- Browser: Chrome 131.0.0.0
- OS: macOS
Actual Results
✅ Issue addressed by the patch.
#4
@
20 months ago
Test Report
Description
This report validates whether the indicated patch works as expected.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/7885.diff
Environment
- WordPress: 6.8-alpha-59274-src
- PHP: 8.2.25
- Server: nginx/1.27.2
- Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
- Browser: Chrome 129.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.0
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.0
Actual Results
- ✅ Issue resolved with patch.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/62562