WP_Comment_Query() displays “password protected” comments?

It’s not a bug (gasp!) really just not provided for. You have to add a filter to do this, eg add_filter( ‘comments_clauses’, function ( $pieces, $query ) { if ( empty( $query->query_vars[‘wpse_no_password’] ) ) return $pieces; global $wpdb; $pieces[ ‘where’ ] .= $wpdb->prepare( ‘ AND ‘ . $wpdb->posts . ‘.post_password = %s’, ” ); return … Read more

Custom WP_Comment_Query with pagination and orderby?

The goal was to paginate comments, showing comments with the highest comment_rating meta value first. Thanks to the answer of cjbj and the comments by Milo and birgire I figured out the rather unintuitive solution to the issue. By using numberand offset I was able to make the results in the proper order, but pagination … Read more