Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
Created October 16, 2013 08:05
Show Gist options
  • Select an option

  • Save jamiemitchell/7004251 to your computer and use it in GitHub Desktop.

Select an option

Save jamiemitchell/7004251 to your computer and use it in GitHub Desktop.
/**
* Show WP-PostRatings dislikes for a post
*
* For use with a +1 and -1 system
*
*/
function ac_get_post_dislikes() {
global $post;
$ratings_users = intval( get_post_meta( $post->ID, 'ratings_users', true) );
$ratings_score = intval( get_post_meta( $post->ID, 'ratings_score', true) );
$post_dislikes = ( $ratings_users - $ratings_score ) / 2;
return $post_dislikes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment