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})" );

		foreach ( (array) $reputations as $rep ) {
			$rep->points = ap_get_reputation_event_points( $rep->rep_event );
			$this->append_ref_data( 'reputation', $rep->rep_id, $rep );
		}
	}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment