WordPress at a glance
function is not described

WP_Query::__construct() public WP 1.5.0

Constructor.

Sets up the WordPress query, if parameter is not empty.

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

No Hooks.

Return

Null. Nothing.

Usage

global $wp_query;
$wp_query->__construct( $query );
$query(string/array)
URL query string or array of vars.
Default: ''

Notes

  • See: WP_Query::parse_query() for all available arguments.

Changelog

Since 1.5.0 Introduced.

Code of WP_Query::__construct() WP 5.5.1

<?php
public function __construct( $query = '' ) {
	if ( ! empty( $query ) ) {
		$this->query( $query );
	}
}