Retrieve the currently-queried object. Wrapper for $wp_query->get_queried_object()

Signature

get_queried_object()

Return

(object)

Source

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

Link here