Created
June 13, 2016 15:54
-
-
Save sunnyratilal/7d814cd99d0ea006355d01afea1a4d8f to your computer and use it in GitHub Desktop.
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
<?php | |
function query_reviews() { | |
global $post; | |
remove_action( 'pre_get_comments', array( edd_reviews(), 'hide_reviews' ) ); | |
remove_filter( 'comments_clauses', array( edd_reviews(), 'hide_reviews_from_comment_feeds_compat' ), 10, 2 ); | |
remove_filter( 'comment_feed_where', array( edd_reviews(), 'hide_reviews_from_comment_feeds' ), 10, 2 ); | |
$reviews = get_comments( array( | |
'post_id' => $post->ID, | |
'type' => 'edd_review', | |
) ); | |
add_action( 'pre_get_comments', array( edd_reviews(), 'hide_reviews' ) ); | |
add_filter( 'comments_clauses', array( edd_reviews(), 'hide_reviews_from_comment_feeds_compat' ), 10, 2 ); | |
add_filter( 'comment_feed_where', array( edd_reviews(), 'hide_reviews_from_comment_feeds' ), 10, 2 ); | |
return $reviews; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment