WordPress.org

Make WordPress Core

Ticket #14015: get_queried_object_wrapper.14015.diff

File get_queried_object_wrapper.14015.diff, 919 bytes (added by filosofo, 8 years ago)
  • wp-includes/query.php

     
    2727        return $wp_query->get($var);
    2828}
    2929
     30
    3031/**
     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();
     59}
     60
     61/**
    3162 * Set query variable.
    3263 *
    3364 * @see WP_Query::set()