Merge pull request #18883 from woocommerce/fix/18881
If using get_catalog_ordering_args. remove the args when finsihed
This commit is contained in:
commit
2b96d68047
|
@ -444,6 +444,7 @@ class WC_Template_Loader {
|
||||||
|
|
||||||
// Remove actions and self to avoid nested calls.
|
// Remove actions and self to avoid nested calls.
|
||||||
remove_action( 'pre_get_posts', array( wc()->query, 'product_query' ) );
|
remove_action( 'pre_get_posts', array( wc()->query, 'product_query' ) );
|
||||||
|
WC()->query->remove_ordering_args();
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$in_content_filter = false;
|
self::$in_content_filter = false;
|
||||||
|
|
|
@ -525,10 +525,8 @@ class WC_Shortcode_Products {
|
||||||
set_transient( $transient_name, $results, DAY_IN_SECONDS * 30 );
|
set_transient( $transient_name, $results, DAY_IN_SECONDS * 30 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Remove ordering query arguments.
|
// Remove ordering query arguments which may have been added by get_catalog_ordering_args.
|
||||||
if ( ! empty( $this->attributes['category'] ) ) {
|
WC()->query->remove_ordering_args();
|
||||||
WC()->query->remove_ordering_args();
|
|
||||||
}
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue