Make WordPress Core

Opened 8 weeks ago

Last modified 7 weeks ago

#62562 new enhancement

Ensure get_current_screen() returns WP_Screen|null

Reported by: marian1's profile marian1 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: trivial Version:
Component: Administration Keywords: has-patch dev-feedback
Focuses: Cc:

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 (4)

This ticket was mentioned in PR #7885 on WordPress/wordpress-develop by @marian1.


8 weeks ago
#1

  • Keywords has-patch added; needs-patch removed

#2 @mayanktripathi32
8 weeks ago

  • Keywords dev-feedback needs-testing added

#3 @abcd95
7 weeks 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 @im3dabasia1
7 weeks 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

  1. ✅ Issue resolved with patch.
Note: See TracTickets for help on using tickets.