Created
January 11, 2016 18:20
-
-
Save manchumahara/dd1916e4c674d7c23286 to your computer and use it in GitHub Desktop.
CBX Rating & Review - order by avg rating using meta key for any form id http://wpboxr.com/cbx-multi-criteria-rating-review-system-documentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$form_id = 5; //suppose we want to sort woocommerce products with avg rating using custom query | |
$args = array( | |
'post_type' => 'product', | |
'orderby' => 'meta_value_num', | |
'meta_key' => 'cbrating'.$form_id | |
); | |
$query = new WP_Query( $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment