Check query var for orderby

This commit is contained in:
claudiulodro 2018-03-23 08:30:02 -07:00
parent 5e473cd88f
commit 62d88892bf
1 changed files with 1 additions and 1 deletions

View File

@ -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() ) {