WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#12631 closed defect (bug) (fixed)

the_title filter gets inconsistent arguments

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

Description

In get_the_title() it's passed the post ID, but in the other (mostly more recently introduced) uses of the filter, it gets a post object.

I think we should go with passing the ID since get_the_title() is most likely the use in which people would want the ID filter.

Attachments (1)

consistent_the_title_filter.12631.diff (1.5 KB) - added by filosofo 4 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 dd324 years ago

See also: #4893 "Audit of all filter and action names." - Specifically mentions the_title

comment:2 nacin4 years ago

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

(In [14653]) Always pass post ID, not post object, to the_title filter. Original the_title filter in get_the_title() uses ID only. props filosofo, fixes #12631.

Note: See TracTickets for help on using tickets.