Make WordPress Core

Opened 20 months ago

Closed 15 months ago

Last modified 8 months ago

#56535 closed enhancement (duplicate)

Improve the compatibility of WP_Admin_Bar with PHP 8.2

Reported by: antonvlasenko's profile antonvlasenko Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Toolbar Keywords: has-patch has-unit-tests php82
Focuses: Cc:


The WP_Admin_Bar class currently uses the __get magic method to return values for some of its properties.
These dynamic properties are not supported in PHP 8.2 and above.
Therefore, WP_Admin_Bar should be refactored to remove the dynamic properties while ensuring that backward compatibility is preserved.

Change History (7)

#1 @antonvlasenko
20 months ago

I'm working on a patch for this issue.

This ticket was mentioned in PR #3216 on WordPress/wordpress-develop by anton-vlasenko.

20 months ago

  • Keywords has-patch has-unit-tests added

This PR aims to improve compatibility of the WP_Admin_Bar class with PHP 8.2 and above by removing dynamic properties while making sure that this won't break backward compatibility.

Trac ticket:

#3 @SergeyBiryukov
20 months ago

  • Component changed from General to Toolbar
  • Keywords php82 added

#4 @desrosj
19 months ago

  • Milestone changed from Awaiting Review to Future Release
  • Version trunk deleted

#5 @antonvlasenko
15 months ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #56876.

This issue is closed in favor of, and the related changes have been moved from to
This ensures that all the classes with the self::$compat_fields property get fixed in the scope of a single PR.

#7 @desrosj
8 months ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.