BlocksWpQuery::__construct() – Constructor.

You appear to be a bot. Output may be restricted

Description

Constructor.

Sets up the WordPress query, if parameter is not empty. Unlike the constructor in WP_Query, this does not RUN the query.

Usage

BlocksWpQuery::__construct( $query );

Parameters

$query
( string|array ) optional – URL query string or array of vars.

Returns

void

Source

File name: woocommerce/packages/woocommerce-blocks/src/Utils/BlocksWpQuery.php
Lines:

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

 View on GitHub View on Trac