WP_Query::get_queried_object_id(): int

In this article

Retrieves the ID of the currently queried object.

Return

int

Source

 * @return WP_Term|WP_Post_Type|WP_Post|WP_User|null The queried object.
 */
public function get_queried_object() {
	if ( isset( $this->queried_object ) ) {
		return $this->queried_object;
	}

	$this->queried_object    = null;
	$this->queried_object_id = null;

Changelog

VersionDescription
1.5.0Introduced.

User Contributed Notes

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