Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 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 8 years ago.

Download all attachments as: .zip

Change History (6)

#1 @Denis-de-Bernardy
8 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.

#2 @jfarthing84
8 years ago

  • Keywords dev-feedback added; reporter-feedback removed

Mainly to manipulate the is_* template functions...

#3 @dd32
8 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)

#4 @scribu
8 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.

#5 @jfarthing84
8 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.