Skip to content

Commit

Permalink
Merge pull request woocommerce#15784 from woocommerce/fix/15769
Browse files Browse the repository at this point in the history
get_catalog_ordering_args should cast orderby to string
  • Loading branch information
claudiosanches authored Jun 26, 2017
2 parents 4972e83 + a907fd8 commit cb0abd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-wc-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public function remove_posts_where() {
public function get_catalog_ordering_args( $orderby = '', $order = '' ) {
// Get ordering from query string unless defined
if ( ! $orderby ) {
$orderby_value = isset( $_GET['orderby'] ) ? wc_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );
$orderby_value = isset( $_GET['orderby'] ) ? wc_clean( (string) $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) );

// Get order + orderby args from string
$orderby_value = explode( '-', $orderby_value );
Expand Down

0 comments on commit cb0abd5

Please sign in to comment.