AnsPress_Reputation_Query::prefetch_comments()
Description #
Pre fetch comments and append data to object.
Source #
File: includes/reputation.php
public function prefetch_comments() {
global $wpdb;
if ( empty( $this->ids['comment'] ) ) {
return;
}
$ids = esc_sql( sanitize_comma_delimited( $this->ids['comment'] ) );
$comments = $wpdb->get_results( "SELECT * FROM {$wpdb->comments} WHERE comment_ID in ({$ids})" ); // phpcs:ignore WordPress.DB
foreach ( (array) $comments as $_comment ) {
$this->reputations[ $this->pos[ $_comment->comment_ID ] ]->ref = $_comment;
}
}
Expand full source code Collapse full source code View on GitHub: includes/reputation.php:735
Add your comment