Automattic\WooCommerce\Blocks\Utils
BlocksWpQuery::__construct()
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() BlocksWpQuery:: construct code WC 9.4.2
public function __construct( $query = '' ) { if ( ! empty( $query ) ) { $this->init(); $this->query = wp_parse_args( $query ); $this->query_vars = $this->query; $this->parse_query_vars(); } }