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

git-svn-id: https://develop.svn.wordpress.org/trunk@16091 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-10-29 20:48:54 +00:00
parent d39d7e4ba4
commit af17458ed9
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);
}
/**
* 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.
*