Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#14015 closed enhancement (fixed)

Wrappers for get_queried_object() and get_queried_object_id()

Reported by: filosofo Owned by: filosofo
Priority: normal Milestone: 3.1
Component: Template Version: 3.0
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

I am frequently writing

$GLOBALS['wp_query']->get_queried_object()

and

$GLOBALS['wp_query']->get_queried_object_id()

We have wrappers for other WP_Query methods; these seem like obvious candidates.

Patch replaces the above with the following, respectively:

get_queried_object()

and

get_queried_object_id()

Attachments (1)

get_queried_object_wrapper.14015.diff​ (919 bytes ) - added by filosofo 16 years ago.

Download all attachments as: .zip

Change History (6)

#1 @filosofo
16 years ago

  • Owner set to filosofo
  • Status new → accepted

#2 @nacin
16 years ago

  • Keywords commit added
  • Milestone Awaiting Triage → 3.1

#3 @filosofo
16 years ago

Patch still applies cleanly.

#4 @ryan
16 years ago

  • Resolution → fixed
  • Status accepted → closed

(In [16091]) get_queried_obecjt() and get_queried_object_id(). Props filosofo. fixes #14015

#5 @scribu
16 years ago

(In [16114]) use get_queried_object() wrappers throughout. See #14015

Note: See TracTickets for help on using tickets.