get_queried_object_id(): int

In this article

Retrieves the ID of the currently queried object.

Description

Wrapper for WP_Query::get_queried_object_id().

Return

int ID of the queried object.

Source

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

Changelog

VersionDescription
3.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.