Automattic\WooCommerce\Blocks\Utils

BlocksWpQuery::__construct()publicWC 1.0

Constructor.

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

Unlike the constructor in WP_Query, this does not RUN the query.

Method of the class: BlocksWpQuery{}

No Hooks.

Return

null. Nothing (null).

Usage

$BlocksWpQuery = new BlocksWpQuery();
$BlocksWpQuery->__construct( $query );
$query(string|array)
URL query string or array of vars.
Default: ''

BlocksWpQuery::__construct() code WC 8.7.0

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