get_queried_object_id() – Retrieve ID of the current queried object.

You appear to be a bot. Output may be restricted

Description

Retrieves the ID of the currently queried object.

Wrapper for WP_Query::get_queried_object_id().

Usage

$int = get_queried_object_id();

Parameters

Returns

int ID of the queried object.

Source

File name: wordpress/wp-includes/query.php
Lines:

1 to 4 of 4
function get_queried_object_id() {
  global $wp_query;
  return $wp_query->get_queried_object_id();
}
 

 View on GitHub View on Trac