Skip to content

Instantly share code, notes, and snippets.

@LinzardMac
Created May 24, 2013 00:15
Show Gist options
  • Save LinzardMac/5640482 to your computer and use it in GitHub Desktop.
Save LinzardMac/5640482 to your computer and use it in GitHub Desktop.
/**
* Retrieve variable in the WP_Query class.
*
* @see WP_Query::get()
* @since 1.5.0
* @uses $wp_query
*
* @param string $var The variable key to retrieve.
* @return mixed
*/
function get_query_var($var) {
global $wp_query;
//line 27 below
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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment