You appear to be a bot. Output may be restricted
Description
Parse query args.
Usage
AbstractProductGrid::set_ordering_query_args( $query_args );
Parameters
- $query_args
- ( array ) required – Query args.
Returns
void
Source
File name: woocommerce/packages/woocommerce-blocks/src/BlockTypes/AbstractProductGrid.php
Lines:
1 to 21 of 21
protected function set_ordering_query_args( &$query_args ) { if ( isset( $this->attributes['orderby'] ) ) { if ( 'price_desc' === $this->attributes['orderby'] ) { $query_args['orderby'] = 'price'; $query_args['order'] = 'DESC'; } elseif ( 'price_asc' === $this->attributes['orderby'] ) { $query_args['orderby'] = 'price'; $query_args['order'] = 'ASC'; } elseif ( 'date' === $this->attributes['orderby'] ) { $query_args['orderby'] = 'date'; $query_args['order'] = 'DESC'; } else { $query_args['orderby'] = $this->attributes['orderby']; } } $query_args = array_merge( $query_args, WC()->query->get_catalog_ordering_args( $query_args['orderby'], $query_args['order'] ) ); }