WordPress.org

Make WordPress Core

Changeset 16091


Ignore:
Timestamp:
10/29/2010 08:48:54 PM (9 years ago)
Author:
ryan
Message:

get_queried_obecjt() and get_queried_object_id(). Props filosofo. fixes #14015

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r16053 r16091  
    2626
    2727    return $wp_query->get($var);
     28}
     29
     30
     31/**
     32 * Retrieve the currently-queried object.  Wrapper for $wp_query->get_queried_object()
     33 *
     34 * @uses WP_Query::get_queried_object
     35 *
     36 * @since 3.1.0
     37 * @access public
     38 *
     39 * @return object
     40 */
     41function get_queried_object() {
     42    global $wp_query;
     43    return $wp_query->get_queried_object();
     44}
     45
     46/**
     47 * Retrieve ID of the current queried object. Wrapper for $wp_query->get_queried_object_id()
     48 *
     49 * @uses WP_Query::get_queried_object_id()
     50 *
     51 * @since 3.1.0
     52 * @access public
     53 *
     54 * @return int
     55 */
     56function get_queried_object_id() {
     57    global $wp_query;
     58    return $wp_query->get_queried_object_id();
    2859}
    2960
Note: See TracChangeset for help on using the changeset viewer.