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.

Метод класса: BlocksWpQuery{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$BlocksWpQuery = new BlocksWpQuery();
$BlocksWpQuery->__construct( $query );
$query(строка|массив)
URL query string or array of vars.
По умолчанию: ''

Код BlocksWpQuery::__construct() 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();
	}
}