Make WordPress Core

Opened 16 years ago

Closed 11 years ago

#9666 closed enhancement (worksforme)

Pass object id in the various formatting filters

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Template Keywords:
Focuses: Cc:

Description

This is a consolidated ticket, in reference to #9319 and #5746.

Both were requests to pass either of $post or $post->ID as an argument to the_title (both have patches for that).

The same idea could be applied to multitudes of other formatting hooks. They're not always called in the loop, so determining the ID of the object (post, link, category, tag, etc.) isn't always easy in the event that it is useful.

Suggested enhancement:

each filter such as the_title, the_content, etc., but also the_permalink, the_category_link, etc., possibly also the_category, etc., as well... basically any hook that is formatting related and that affects an individual object rather than a collection, should have the object's ID as an argument for easy reference.

Change History (7)

#1 @Denis-de-Bernardy
16 years ago

  • Component changed from General to Template

#3 @Denis-de-Bernardy
16 years ago

Loosely related: #8918

#4 @ryan
16 years ago

(In [11112]) Pass post ID to the_title filter. Props DD32. see #5746 #9666

#5 @Denis-de-Bernardy
16 years ago

  • Keywords 2nd-opinion removed

#6 @Japh
12 years ago

  • Cc japh@… added

#7 @ocean90
11 years ago

  • Keywords needs-patch removed
  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

I think it's safe to close this one. Most functions already have an object id argument. the_permalink() has its own ticket: #23882.

Note: See TracTickets for help on using tickets.