[wp-trac] [WordPress Trac] #61890: Handle WP_Term known, named dynamic properties for PHP 8.2

WordPress Trac noreply at wordpress.org
Tue Aug 20 20:05: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:
 Severity:  minor                    |  Resolution:
 Keywords:  php82 has-patch has-     |     Focuses:  coding-standards, php-
  unit-tests                         |  compatibility
-------------------------------------+-------------------------------------

Comment (by hellofromTonya):

 In [changeset:"58919" 58919]:
 {{{
 #!CommitTicketReference repository="" revision="58919"
 Tests: Remove WP_Term::$filter property unset() within term tests.

 Removes the `unset()` of the `WP_Term::$filter` property within the term
 tests.

 Why?

 Prior to the introduction of WP_Term, the term was added to the cache when
 its filter property was empty. To test the cache, the tests unset this
 property to trigger `wp_cache_add()` in `get_term()`. [34997] changed that
 behavior to trigger `wp_cache_add()` when the term was not found after
 `wp_cache_get()` (i.e. happened in `WP_Term::get_instance()`).

 Unsetting the filter property is and was not needed. Prior to `WP_Term`,
 the condition was an empty value. With `WP_Term`, the filter property is
 no longer part of the conditional logic for caching.

 Follow-up to [34997], [30954], [34035].

 See #61890, #61530.
 }}}

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


More information about the wp-trac mailing list