Retrieve ID of the current queried object. Wrapper for $wp_query->get_queried_object_id()

Signature

get_queried_object_id()

Return

(int)

Source

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

Link here