WP_Query::__construct()publicWP 1.5.0

Constructor.

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

Method of the class: WP_Query{}

No Hooks.

Return

null. Nothing (null).

Usage

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

Notes

Changelog

Since 1.5.0 Introduced.

WP_Query::__construct() code WP 6.6.2

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