Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12535 closed enhancement (worksforme)

Add actions/filters to WP_Query::get_queried_object()

Reported by: jfarthing84 Owned by: ryan
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Query Keywords: dev-feedback has-patch
Focuses: Cc:


I propose that we add a couple of actions/filters to the WP_Query::get_queried_object() function. See attached file.

Attachments (1)

query.php.diff (552 bytes) - added by jfarthing84 6 years ago.

Download all attachments as: .zip

Change History (6)

@jfarthing846 years ago

comment:1 @Denis-de-Bernardy6 years ago

  • Keywords reporter-feedback added; dev-feedback removed
  • Milestone changed from Unassigned to Future Release
  • Type changed from defect (bug) to enhancement

It would help to understand what these are for, and why the various hooks in WP_Query aren't already suitable.

comment:2 @jfarthing846 years ago

  • Keywords dev-feedback added; reporter-feedback removed

Mainly to manipulate the is_* template functions...

comment:3 @dd326 years ago

Mainly to manipulate the is_* template functions...

That'd be better applied via a proper action such as this one: do_action_ref_array('parse_query', array(&$this)); (Query.php L#1539)

comment:4 @scribu6 years ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Failing that, you could manipulate the queried_object variable directly, after instantiation.

comment:5 @jfarthing846 years ago

@scribu: That will work for now. That is, until WP goes PHP 5+ and utilizes OOP (if it ever does).

Note: See TracTickets for help on using tickets.