WP_Query::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.

Usage

$int = WP_Query::get_queried_object_id();

Parameters

Returns

int

Source

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

1 to 9 of 9
  public function get_queried_object_id() {
    $this->WP_Query::get_queried_object();

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

    return 0;
  }
 

 View on GitHub View on Trac