Created
November 10, 2017 16:49
-
-
Save n7studios/3c7c67dc7acb73230dab223c0307db0b to your computer and use it in GitHub Desktop.
Comment Rating Field Pro Plugin: Get Posts Sorted by Rating: https://www.wpzinc.com/documentation/comment-rating-field-pro-plugin/developers-get-posts-sorted-rating/
This file contains hidden or 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
<?php | |
/** | |
* For developers who wish to get an array of Posts ordered by rating, highest to lowest, the | |
* below code can be used. | |
* | |
* @param array $args WP_Query compatible arguments | |
*/ | |
if ( function_exists( 'get_posts_ordered_by_rating' ) ) { | |
$posts = get_posts_ordered_by_rating( array( | |
'post_type' => 'post', | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment