Notifications::prefetch_reputations()
Description #
Prefetch notification reputations.
Source #
File: addons/notifications/query.php
public function prefetch_reputations() { global $wpdb; if ( empty( $this->ids['reputation'] ) ) { return; } $ids = esc_sql( sanitize_comma_delimited( $this->ids['reputation'] ) ); $reputations = $wpdb->get_results( "SELECT rep_id, rep_event FROM {$wpdb->ap_reputations} WHERE rep_id in ({$ids})" ); // phpcs:ignore WordPress.DB foreach ( (array) $reputations as $rep ) { $rep->points = ap_get_reputation_event_points( $rep->rep_event ); $this->append_ref_data( 'reputation', $rep->rep_id, $rep ); } }
Expand full source code Collapse full source code View on GitHub: addons/notifications/query.php:173
Add your comment