Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#55357 closed defect (bug) (duplicate)

Add object_id property to WP_Term class

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

Description

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
5 years ago

  • Keywords php82 added; php81 removed

#2 @jrf
4 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
4 years ago

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

#4 @jrf
4 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
4 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

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

Note: See TracTickets for help on using tickets.