WP_Query::__construct()
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
- See: WP_Query::parse_query() for all available arguments.
Changelog
Since 1.5.0 | Introduced. |
WP_Query::__construct() WP Query:: construct code WP 6.6.2
public function __construct( $query = '' ) { if ( ! empty( $query ) ) { $this->query( $query ); } }