Check query var for orderby
This commit is contained in:
parent
5e473cd88f
commit
62d88892bf
|
@ -427,7 +427,7 @@ class WC_Query {
|
|||
public function get_catalog_ordering_args( $orderby = '', $order = '' ) {
|
||||
// Get ordering from query string unless defined.
|
||||
if ( ! $orderby ) {
|
||||
$orderby_value = isset( $_GET['orderby'] ) ? wc_clean( (string) wp_unslash( $_GET['orderby'] ) ) : ''; // WPCS: sanitization ok, input var ok, CSRF ok.
|
||||
$orderby_value = isset( $_GET['orderby'] ) ? wc_clean( (string) wp_unslash( $_GET['orderby'] ) ) : wc_clean( get_query_var( 'orderby' ) ); // WPCS: sanitization ok, input var ok, CSRF ok.
|
||||
|
||||
if ( ! $orderby_value ) {
|
||||
if ( is_search() ) {
|
||||
|
|
Loading…
Reference in New Issue