Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#35015 closed enhancement (fixed)

Pass $id to filters in the_guid and get_the_guid()

Reported by: danielbachhuber's profile danielbachhuber Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

Because $id can be passed to the_guid(), filter callbacks can't be 100% precise by assuming $id should be the global post.

Attachments (2)

35015.1.diff (1.0 KB) - added by danielbachhuber 9 years ago.
35015.2.diff (1.9 KB) - added by SergeyBiryukov 9 years ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
9 years ago

In get_the_title(), if $id is 0 or a post object, we resolve it and pass the actual post ID to the filter.

We should probably do the same here for consistency. See 35015.2.diff.

Last edited 9 years ago by SergeyBiryukov (previous) (diff)

#2 @danielbachhuber
9 years ago

Works for me!

#3 @SergeyBiryukov
9 years ago

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

In 35867:

Post Template: Pass the post ID to the_guid and get_the_guid filters.

Props danielbachhuber for initial patch.
Fixes #35015.

Note: See TracTickets for help on using tickets.