This are my current parameters for WP_Query:
array(5) {
["posts_per_page"]=>
int(6)
["orderby"]=>
array(2) {
["uss_product_price"]=>
string(3) "ASC"
["uss_product_weight"]=>
string(4) "DESC"
}
["meta_query"]=>
array(3) {
["relation"]=>
string(3) "AND"
["sortprimary_clause"]=>
array(2) {
["key"]=>
string(17) "uss_product_price"
["compare"]=>
string(6) "EXISTS"
}
["sortsecondary_clause"]=>
array(2) {
["key"]=>
string(18) "uss_product_weight"
["compare"]=>
string(6) "EXISTS"
}
}
["paged"]=>
string(1) "1"
["post_type"]=>
string(7) "product"
}
This new kind of orderby was introduced in WordPress 4.0 and 4.2: https://make.wordpress.org/core/2014/08/29/a-more-powerful-order-by-in-wordpress-4-0/ https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/
The query basically works however the products are ordered by the string value of uss_product_price and uss_product_weight. Previously this problem was solved by giving meta_value_num instead of meta_value in WP_Query: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
I want the result to be ordered by the numeric value of uss_product_price (first) and uss_product_weight (second). How can I tell the query to use the numeric value while still using the complexity of multiple orderby parameters?