WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#30327 closed enhancement (fixed)

Pass query reference to "the_post" action

Reported by: tlovett1 Owned by: boonebgorges
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.1
Component: Query Keywords: has-patch
Focuses: Cc:

Description

An action is fired in WP_Query::setup_postdata "the_post". Right now it is passed a reference to the current post. It would be nice to also pass a reference to the current query so someone can hook onto this action and do things with the post depending on the type of query.

Attachments (1)

the-post-pass-query-ref.diff (423 bytes) - added by tlovett1 6 years ago.
Patch that passes reference to current query to "the_post"

Download all attachments as: .zip

Change History (4)

@tlovett1
6 years ago

Patch that passes reference to current query to "the_post"

#1 @tlovett1
6 years ago

  • Keywords has-patch added

#2 @boonebgorges
6 years ago

  • Milestone changed from Awaiting Review to 4.1
  • Owner set to boonebgorges
  • Status changed from new to accepted

Yessir.

#3 @boonebgorges
6 years ago

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

In 30323:

Pass query object to 'the_post' filter.

Props tlovett1.
Fixes #30327.

Note: See TracTickets for help on using tickets.