Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save n7studios/3c7c67dc7acb73230dab223c0307db0b to your computer and use it in GitHub Desktop.
Save n7studios/3c7c67dc7acb73230dab223c0307db0b to your computer and use it in GitHub Desktop.
<?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