[wp-trac] [WordPress Trac] #61890: Handle WP_Term known, named dynamic properties for PHP 8.2
WordPress Trac
noreply at wordpress.org
Mon Aug 26 20:03:37 UTC 2024
#61890: Handle WP_Term known, named dynamic properties for PHP 8.2
-------------------------------------+-------------------------------------
Reporter: hellofromTonya | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.7
Component: Taxonomy | Version: 4.4
Severity: minor | Resolution:
Keywords: php82 has-patch has- | Focuses: coding-standards, php-
unit-tests needs-testing needs- | compatibility
dev-note has-testing-info |
-------------------------------------+-------------------------------------
Comment (by hellofromTonya):
Proposed Patch: https://github.com/WordPress/wordpress-develop/pull/7231
Hello @lopo (Yoast), @louiswol94 @illuminea (Elementor), @adrianduffell
@nerrad @beaulebens (WooCommerce), @ironprogrammer (to help test and/or
identify a contact at Jetpack), @jjj (BuddyPress and bbPress),
@takayukister (Contact Form), @borkweb @bordoni (The Events Calendar).
Appreciate you testing the proposed patch with your products and providing
feedback. This patch is currently earmarked to land in 6.7.0.
**The What**
The proposed patch adds full support for dynamic properties in `WP_Term`
by providing a ''full set of magic methods''. Note: `isset()` will now
work for `WP_Term` dynamic properties.
It also recommends using `WP_Term::to_array()` instead of directly casting
from an object to an array (i.e. instead of doing `(array) $term`).
**The Why**
For PHP 8.2+ compatibility and to resolve the anticipated future fatal
error of PHP 9+ when dynamic properties are hard removed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61890#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list