Make WordPress Core

Opened 11 years ago

Closed 11 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 11 years ago.
35015.2.diff (1.9 KB) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
11 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. See 35015.2.diff.

Version 0, edited 11 years ago by SergeyBiryukov (next)

#2 @danielbachhuber
11 years ago

Works for me!

#3 @SergeyBiryukov
11 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.