WordPress at a glance
function is not described

WP_Query::get_queried_object_id() public WP 1.5.0

Retrieve ID of the current queried object.

{} It's a method of the class: WP_Query{}

No Hooks.

Return

Int.

Usage

global $wp_query;
$wp_query->get_queried_object_id();

Changelog

Since 1.5.0 Introduced.

Code of WP_Query::get_queried_object_id() WP 5.5.2

<?php
public function get_queried_object_id() {
	$this->get_queried_object();

	if ( isset( $this->queried_object_id ) ) {
		return $this->queried_object_id;
	}

	return 0;
}