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

git-svn-id: http://svn.automattic.com/wordpress/trunk@16091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-10-29 20:48:54 +00:00
parent 28466e59f1
commit b2e698ed3d
1 changed files with 31 additions and 0 deletions

View File

@ -27,6 +27,37 @@ function get_query_var($var) {
return $wp_query->get($var); return $wp_query->get($var);
} }
/**
* Retrieve the currently-queried object. Wrapper for $wp_query->get_queried_object()
*
* @uses WP_Query::get_queried_object
*
* @since 3.1.0
* @access public
*
* @return object
*/
function get_queried_object() {
global $wp_query;
return $wp_query->get_queried_object();
}
/**
* Retrieve ID of the current queried object. Wrapper for $wp_query->get_queried_object_id()
*
* @uses WP_Query::get_queried_object_id()
*
* @since 3.1.0
* @access public
*
* @return int
*/
function get_queried_object_id() {
global $wp_query;
return $wp_query->get_queried_object_id();
}
/** /**
* Set query variable. * Set query variable.
* *