[wp-trac] [WordPress Trac] #58897: Fix WP_User_Query magic methods for PHP 8.2 dynamic property

WordPress Trac noreply at wordpress.org
Wed Aug 2 19:13:42 UTC 2023


#58897: Fix WP_User_Query magic methods for PHP 8.2 dynamic property
--------------------------------------------+-----------------------------
 Reporter:  antonvlasenko                   |       Owner:  hellofromTonya
     Type:  defect (bug)                    |      Status:  assigned
 Priority:  normal                          |   Milestone:  6.4
Component:  Users                           |     Version:  4.0
 Severity:  normal                          |  Resolution:
 Keywords:  php82 has-patch has-unit-tests  |     Focuses:
--------------------------------------------+-----------------------------

Comment (by hellofromTonya):

 Historical context:

 === Original design before the magic methods

 During 3.1, [15491] / #14579:
 * Added the `WP_User_Query` class.
 * Marked its `var $results` and `var $total_users` as `@access private`,
 meaning intended for only internal usage within the object.

 === Changes that added the magic methods

 These changes were made for backwards-compatibility (BC), as the
 properties were public (via `var`) and thus might have been used outside
 of WordPress Core.

 During 4.0.0, [28528] / #27881:

 * Added the `_get()`, `__set()`, `__isset()` and `__unset()` magic methods
 * Added visibility keywords for properties and methods, including
 replacing `var` with `private` for the 2 properties.

 During 4.2.0, [31144] / #30891:
 * Added the list of `compat_fields` and the logic in each of the property
 magic methods.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58897#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list