Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#55357 closed defect (bug) (duplicate)

Add object_id property to WP_Term class

Reported by: spacedmonkey's profile spacedmonkey Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: php82 needs-patch needs-unit-tests
Focuses: Cc:


When calling get_terms and WP_Term_Query with fields equal to all_with_object_id, the array of WP_Term objects that are returned, also have a object_id property set. This property is not defined as part of the class. WordPress should not be defining dynamically properties like this.

Change History (5)

#1 @jrf
2 years ago

  • Keywords php82 added; php81 removed

#2 @jrf
2 years ago

@spacedmonkey I've done some test runs against PHP 8.2 already and guess what ? There are a hell of a lot more of these....

I actually have prepared commits for the bulk of them already. Wouldn't mind doing a pair programming session to review them all. Would you be up for that ? /cc @hellofromTonya

#3 @spacedmonkey
2 years ago

@jrf Do you have a ticket / patch that is ready for review?

#4 @jrf
2 years ago

@spacedmonkey No, I was waiting to open it for PHP 8.2 alpha 1, but we could transform this ticket to a meta ticket about dynamic properties and I could put a WIP branch up on GitHub and/or open a draft PR based on that branch.

#5 @jrf
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Closing in favour of the more comprehensive ticket #56034 (and the related ticket #56033).

Note: See TracTickets for help on using tickets.