Do not apply ordering to feeds

Closes #16902
This commit is contained in:
Mike Jolley 2017-09-25 13:08:08 +01:00
parent 6c7aa18199
commit 83a64c048d
1 changed files with 8 additions and 5 deletions

View File

@ -370,11 +370,14 @@ class WC_Query {
* @param mixed $q
*/
public function product_query( $q ) {
$ordering = $this->get_catalog_ordering_args();
$q->set( 'orderby', $ordering['orderby'] );
$q->set( 'order', $ordering['order'] );
if ( isset( $ordering['meta_key'] ) ) {
$q->set( 'meta_key', $ordering['meta_key'] );
if ( ! is_feed() ) {
$ordering = $this->get_catalog_ordering_args();
$q->set( 'orderby', $ordering['orderby'] );
$q->set( 'order', $ordering['order'] );
if ( isset( $ordering['meta_key'] ) ) {
$q->set( 'meta_key', $ordering['meta_key'] );
}
}
// Query vars that affect posts shown