WordPress at a glance

get_queried_object() WP 1.0

Retrieve the currently-queried object.

Wrapper for WP_Query::get_queried_object().

  • Global. WP_Query. $wp_query Global WP_Query instance.
✈ 1 time = 0.000026s = very fast | 50000 times = 0.06s = speed of light

No Hooks.

Return

Object. Queried object.

Usage

get_queried_object();

Code of get_queried_object: wp-includes/query.php VER 4.9.8

<?php
function get_queried_object() {
	global $wp_query;
	return $wp_query->get_queried_object();
}

Related Functions

From tag: query

More from category: Main Query

No comments
    Hello, !     Log In . Register