WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#15944 closed defect (bug) (fixed)

Notice because of non-existent term_id property on post object

Reported by: filosofo Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Template Keywords: has-patch
Focuses: Cc:

Description

WP shouldn't assume that the queried object is a taxonomy term, when checking to make sure that it's not the same as the parent item of the current menu item.

Attachments (1)

dont-assume-queried-object-is-term.15944.diff (650 bytes) - added by filosofo 3 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 follow-up: nacin3 years ago

Looks sane to fix in 3.1, no?

Also looks like a duplicate of #15935. I'll close that one.

comment:2 in reply to: ↑ 1 filosofo3 years ago

Replying to nacin:

Looks sane to fix in 3.1, no?

I see now that it's a regression from 3.0. I plead the fifth about whose patch introduced it.

comment:3 nacin3 years ago

  • Milestone changed from Future Release to 3.1

:-)

comment:4 scribu3 years ago

Couldn't get_queried_object_id() be used instead?

comment:5 filosofo3 years ago

No, because we don't want an accidental coincidence between a post object ID number and term ID number.

comment:6 ryan3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17109]) Don't assume queried object is a term. Fixes non-existent var notice. Props filosofo. fixes #15944

Note: See TracTickets for help on using tickets.