I'm currently create a plugin that takes all comments from all products and places them under the review tab for all comments.
Inside Wordpress I have the following setting checked: Settings > Discussion > Break comments into pages with...
This enables pagination on the default comment section. I've added this code with my code but it doesn't enable pagination, even when I remove the If statement.
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
echo '<nav class="woocommerce-pagination">';
paginate_comments_links( apply_filters( 'woocommerce_comment_pagination_args', array(
'prev_text' => '←',
'next_text' => '→',
'type' => 'list',
) ) );
echo '</nav>';
endif; ?>
I'm currently using this function to call all reviews into one:
function products_all_reviews(){
$args = array ('post_type' => 'product');
$comments = get_comments( $args );
wp_list_comments( apply_filters( 'woocommerce_product_review_list_args', array( 'callback' => 'woocommerce_comments' ) ), $comments );
}
What needs to be done to call/enable pagination properly? This is my first time creating plugin so the help is much appreciated