wpseek.com
A WordPress-centric search engine for devs and theme authors



get_queried_object › WordPress Function

Since3.1.0
Deprecatedn/a
get_queried_object ( No parameters )
Returns:
  • (WP_Term|WP_Post_Type|WP_Post|WP_User|null) The queried object.
Defined at:
Codex:

Retrieves the currently queried object.

Wrapper for WP_Query::get_queried_object().


Source

function get_queried_object() {
	global $wp_query;
	return $wp_query->get_queried_object();
}